【问题标题】:UITableView design as in apple app storeUITableView 设计如苹果应用商店
【发布时间】:2015-11-14 05:27:56
【问题描述】:

我希望创建一个看起来类似于 appstore 应用程序中使用的 uitableview 的 tableview(转到苹果设备上的应用程序商店并选择探索选项卡,在这里你会找到类别表)。任何人都可以建议我如何做到这一点。 Sample

【问题讨论】:

    标签: ios objective-c iphone uitableview


    【解决方案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

    【讨论】:

      猜你喜欢
      • 2014-04-23
      • 2013-04-18
      • 1970-01-01
      • 2013-02-15
      • 1970-01-01
      • 2016-01-26
      • 1970-01-01
      • 1970-01-01
      • 2019-04-21
      相关资源
      最近更新 更多