UITableView单元格下的文本

use*_*225 2 iphone objective-c uitableview

iPhone的设置应用程序是围绕一个UITableview.在某些视图中,单元格之间还有其他文本.例如,在"设置" - >"常规" - >"网络"中,有一个带有UISwitch的单元格下的"使用3G加载数据更快,但可能会缩短电池寿命".任何想法如何实现这一点?

我的意思的图像可以在这里找到:

http://www.tipb.com/2008/07/12/how-to-disable-3g-on-the-iphone-3g-for-more-talk-but-less-speed/

Bol*_*ock 10

如果您有一个分组表视图,协议中的tableView:titleForFooterInSection:方法UITableViewDataSourceUITableViewController类将为您处理:

- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section {
    if (section == 0) {
        return @"Footer text for first section, goes below cells in that group.";
    }

    return nil;
}
Run Code Online (Sandbox Code Playgroud)

要在单元格之间放置该文本,您必须有多个部分,并告诉您的tableView:cellForRowAtIndexPath:方法在下一部分中将您想要的单元格放在该文本下面.