iOS中的UITableViewCell的页脚文本 [英] UITableViewCell's footer text in iOS

查看:53
本文介绍了iOS中的UITableViewCell的页脚文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想喜欢下面的图片。

我该怎么使用?

以下方法是吗?

- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section

谢谢。

推荐答案

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    UIView *footer = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 540, 10)];
    footer.backgroundColor = [UIColor clearColor];

    UILabel *lbl = [[UILabel alloc]initWithFrame:footer.frame];
    lbl.backgroundColor = [UIColor clearColor];
    lbl.text = @"Your Text";
    lbl.textAlignment = NSTextAlignmentCenter;
    [footer addSubview:lbl];

    return footer;
}


- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 10.0;
}

这篇关于iOS中的UITableViewCell的页脚文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆