iphone - UITableView (Section)Footer 总是最大化宽度

标签 iphone objective-c ios

我想构建一个 facebook 应用程序风格的登录 View 。问题是我的页脚 View 总是全宽,而不是我在界面构建器中设置的宽度。

登录按钮是部分页脚。注册按钮是 tableView 的页脚。

  1. 如何使按钮变小(宽度)?
  2. 我想要 View 按钮上的注册按钮。我该怎么做呢? enter image description here

最佳答案

将按钮和其他 View 包装在单独的 View 中。在 viewForFooterInSection: 中:

UIView *wrapper = [[UIView alloc] initWithFrame:aSuitableFrame];
UIButton *loginButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
loginButton.frame = CGRectMake(10,5,self.view.bounds.width-20, 44);
// etc.
[wrapper addSubView:loginButton];
// idem for other views

关于iphone - UITableView (Section)Footer 总是最大化宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9056421/

相关文章:

iphone - 使用 NSPredicate 从复杂的 JSON 资源中过滤 NSArray

iphone - 视网膜@2x 上的电影怎么样?

ios - 在 ios objective c 中通过相机检测物体的速度

iphone - EXC_BAD_ACCESS错误

ios - UIView 坐标转换异常。转换点 : toView: not work well

iphone - iOS 代码显示白色区域而不是图像系列

ios - 如何在App Store中更改App的背景颜色

iphone - iOS 找到核心数据中最常见的记录?

ios - 从后台返回后 UIView 动画被阻止 ios8 (Rubymotion)

ios - 嵌套的 dispatch_async(dispatch_async 在另一个 dispatch_async 中)