2015-11-14 118 views
-1

我期待创建一个类似于appstore应用程序中使用的uitableview(转到苹果设备上的应用程序商店,并选择探索选项卡,在这里你会发现类别表)的tableview。任何人都可以告诉我如何做到这一点。 SampleUITableView设计在苹果应用程序商店

回答

1

您可以用不同的方式实现这一简单的方法

先保存所选单元格指数

- (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

https://www.cocoacontrols.com/controls/jkexpandtableview

UITableViewCell expand on click

+0

感谢您的评论,我会做.. – AnshaD

相关问题