关于 TableView FooterView 宽度设置问题,简单来说就是一句话先设置一个参考 UIView 然后在参考 UIView 放入你想用的控件或视图!
效果图
示例代码
//TableView 底部视图
UIView *tableFooterView = [UIView new];
tableFooterView.frame = CGRectMake(0, 0, kScreenWidth, 80);
//Button 按钮
UIButton *btnExit = [UIButton buttonWithType:UIButtonTypeCustom];
[tableFooterView addSubview:btnExit];
//如果你不是用 Masonry 布局,可以换成自己的方式
[btnExit mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(tableFooterView);
make.size.mas_equalTo(CGSizeMake(kScreenWidth -40,40));
}];
tableView.tableFooterView = tableFooterView;
本文介绍了一种解决TableViewFooterView宽度设置问题的方法。通过创建一个UIView作为参考,并在此基础上添加控件,如Button按钮,利用Masonry布局进行精确位置调整。
6247

被折叠的 条评论
为什么被折叠?



