【发布时间】:2015-11-14 05:27:56
【问题描述】:
我希望创建一个看起来类似于 appstore 应用程序中使用的 uitableview 的 tableview(转到苹果设备上的应用程序商店并选择探索选项卡,在这里你会找到类别表)。任何人都可以建议我如何做到这一点。 Sample
【问题讨论】:
标签: ios objective-c iphone uitableview
我希望创建一个看起来类似于 appstore 应用程序中使用的 uitableview 的 tableview(转到苹果设备上的应用程序商店并选择探索选项卡,在这里你会找到类别表)。任何人都可以建议我如何做到这一点。 Sample
【问题讨论】:
标签: ios objective-c iphone uitableview
您可以通过不同的方式简单地实现这一目标
先保存选中的单元格索引
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
self.selectedRowIndex = [indexPath];
[tableView reload];
}
然后当像这样增加所选行的高度时
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
//check if the index actually exists
if(selectedRowIndex && indexPath.row == selectedRowIndex.row) {
return 100;
}
return 44;
}
供参考Accordion table cell - How to dynamically expand/contract uitableviewcell?
你可以使用库也看看
http://code4app.net/category/tableview
【讨论】: