QQ列表的收缩展开,带动画效果
2011-09-14 14:18
267 查看
-(void)sectionHeaderView:(QQSectionHeaderView*)sectionHeaderView sectionClosed:(NSInteger)section
{
QQList *persons = [lists
objectAtIndex:section];
persons.opened = !persons.opened;
// 收缩+动画 (如果不需要动画直接reloaddata)
NSInteger countOfRowsToDelete = [self.tableView
numberOfRowsInSection:section];
if (countOfRowsToDelete > 0) {
persons.indexPaths = [[NSMutableArray
alloc] init];
for (NSInteger i = 0; i < countOfRowsToDelete; i++) {
[persons.indexPaths
addObject:[NSIndexPath indexPathForRow:i
inSection:section]];
}
[self.tableView
deleteRowsAtIndexPaths:persons.indexPaths
withRowAnimation:UITableViewRowAnimationTop];
}
}
-(void)sectionHeaderView:(QQSectionHeaderView*)sectionHeaderView sectionOpened:(NSInteger)section
{
QQList *persons = [lists
objectAtIndex:section];
persons.opened = !persons.opened;
// 展开+动画 (如果不需要动画直接reloaddata)
if(persons.indexPaths){
[self.tableView
insertRowsAtIndexPaths:persons.indexPaths
withRowAnimation:UITableViewRowAnimationBottom];
}
persons.indexPaths =
nil;
}
{
QQList *persons = [lists
objectAtIndex:section];
persons.opened = !persons.opened;
// 收缩+动画 (如果不需要动画直接reloaddata)
NSInteger countOfRowsToDelete = [self.tableView
numberOfRowsInSection:section];
if (countOfRowsToDelete > 0) {
persons.indexPaths = [[NSMutableArray
alloc] init];
for (NSInteger i = 0; i < countOfRowsToDelete; i++) {
[persons.indexPaths
addObject:[NSIndexPath indexPathForRow:i
inSection:section]];
}
[self.tableView
deleteRowsAtIndexPaths:persons.indexPaths
withRowAnimation:UITableViewRowAnimationTop];
}
}
-(void)sectionHeaderView:(QQSectionHeaderView*)sectionHeaderView sectionOpened:(NSInteger)section
{
QQList *persons = [lists
objectAtIndex:section];
persons.opened = !persons.opened;
// 展开+动画 (如果不需要动画直接reloaddata)
if(persons.indexPaths){
[self.tableView
insertRowsAtIndexPaths:persons.indexPaths
withRowAnimation:UITableViewRowAnimationBottom];
}
persons.indexPaths =
nil;
}
相关文章推荐
- 带动画效果的 QQ 列表收缩展开代码例子
- android列表收缩与展开仿QQ好友列表(非常详细,附源码)
- QQ列表展开收缩扩展(自定义属性,索引值练习)
- ExpandableListView展开收缩加动画效果
- Vue2(三)实现子菜单展开收缩,带动画效果
- vuejs实现折叠面板展开收缩动画效果
- Android列表收缩与展开仿QQ好友列表(非常详细,附源码)
- 在iframe里的页面编写js,实现在父窗口上创建动画效果展开和收缩的div(不变动iframe父窗口代码)
- 在iframe里的页面编写js,实现在父窗口上创建动画效果展开和收缩的div(不变动iframe父窗口代码)
- jquery学习第二天:超链接title提示效果、图片放大提示效果、内容展开收缩动画效果
- JavaScript实现QQ列表展开收缩扩展功能
- 模拟QQ列表展开收缩
- 仿照QQ列表展开效果
- (二十八)QQ好友列表的展开收缩
- Android仿QQ好友列表实现列表收缩与展开
- Android中实现类似qq好友列表展开收起的效果
- (二十八)QQ好友列表的展开收缩
- Android列表收缩与展开仿QQ好友列表(非常详细,附源码)
- OCiOS开发:表格视图实现腾讯好友列表展开收缩效果
- 列表展开收缩效果