设为首页 加入收藏

TOP

iOS 实现QQ界面(二)
2014-11-23 21:31:45 来源: 作者: 【 】 浏览:16
Tags:iOS 实现 界面
表示折叠的,=2表示是打开的;

下面最难的就是,折叠打开的方式了;


-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSMutableDictionary * dictionary = [NSMutableDictionary dictionaryWithDictionary:[_CellArray objectAtIndex:indexPath.row]];

UITableViewCell *cell = [TableV cellForRowAtIndexPath:indexPath];
NSLog(@"%@",cell.textLabel.text);
if([dictionary objectForKey:@"Group"])
{
NSArray *ChildArray = [dictionary objectForKey:@"Child"];
NSMutableArray *PathArray = [NSMutableArray array];

if(cell.tag==1)
{
cell.tag=2;
for (int i =0 ;i {
dictionary = [ChildArray objectAtIndex:i];
[_CellArray insertObject:dictionary atIndex:i+indexPath.row+1];
NSIndexPath *path = [NSIndexPath indexPathForRow:i+indexPath.row+1 inSection:0];
[PathArray addObject:path];
}
[TableV insertRowsAtIndexPaths:PathArray withRowAnimation:UITableViewRowAnimationAutomatic];
}
else
{
cell.tag=1;
NSMutableIndexSet * deleteSet= [NSMutableIndexSet indexSet];
for (NSDictionary *dic in ChildArray)
{
NSInteger row= [_CellArray indexOfObject:dic];
NSIndexPath * Path = [NSIndexPath indexPathForRow:row inSection:0];
[PathArray addObject:Path];
[deleteSet addIndex:row];
}
[_CellArray removeObjectsAtIndexes:deleteSet];
[TableV deleteRowsAtIndexPaths:PathArray withRowAnimation:UITableViewRowAnimationBottom];
}
}

}


好了,QQ界面的源码在


------------------------------------------分割线------------------------------------------


具体下载目录在 /2014年资料/8月/25日/iOS 实现QQ界面


------------------------------------------分割线------------------------------------------


欢迎下载


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇iOS 二级菜单(UITableView实现) 下一篇iOS 购物—个人中心界面

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: