我想构建一个 facebook 应用程序风格的登录 View 。问题是我的页脚 View 总是全宽,而不是我在界面构建器中设置的宽度。
登录按钮是部分页脚。注册按钮是 tableView 的页脚。
- 如何使按钮变小(宽度)?
- 我想要 View 按钮上的注册按钮。我该怎么做呢?
最佳答案
将按钮和其他 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/