【问题标题】:UITableView hide sectionindex but retain sectionsUITableView隐藏sectionindex但保留section
【发布时间】:2010-04-05 22:40:20
【问题描述】:

我们想为 UITableView 实现我们自己的部分索引 UI。

这显然是可能的,因为联系人应用程序是在 iPad 上完成的。有没有办法合法地隐藏当前部分索引? (我可以访问未记录的 _index UIView,但我怀疑这不会与 Apple 合作)

【问题讨论】:

    标签: cocoa-touch uitableview


    【解决方案1】:

    这个答案有帮助。

    这里的诀窍是拥有

    - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView;
    

    返回 nil,同时保留其他基于部分的数据源方法的实现:

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
    

    这似乎说服 tableview 不显示节索引,但仍允许按索引导航。

    【讨论】:

      【解决方案2】:

      【讨论】:

        猜你喜欢
        • 2013-04-25
        • 1970-01-01
        • 2020-10-22
        • 2021-03-25
        • 2019-11-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-06-21
        相关资源
        最近更新 更多