【发布时间】:2014-01-28 11:13:07
【问题描述】:
我的问题标签的问题场景:
- 以纵向模式查看屏幕
- 按主页按钮
- 旋转设备
- 再次查看屏幕
这里是按钮的声明: UIView *bottomButtons = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.width, kBottomButtonsHeight)];
CGFloat buttonWidth = self.tableView.width/2.0;
self.cancelButton = [[MobliButton alloc] initWithFrame:CGRectMake(0, 0, buttonWidth, kBottomButtonsHeight)];
self.cancelButton.backgroundColor = [UIColor colorFromHexString:@"B3B3B3"];
[self.cancelButton addTarget:self action:@selector(dismiss) forControlEvents:UIControlEventTouchUpInside];
[self.cancelButton setTitle:NLS(@"Cancel") forState:UIControlStateNormal];
[self.cancelButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
self.cancelButton.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:16.0];
self.cancelButton.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin;
....
[self.tableView setTableFooterView:bottomButtons];
【问题讨论】:
-
这对我来说似乎是错误的
UIViewAutoresizingFlexibleRightMargin -
@Desdenova,你有什么建议?
-
我会尝试灵活的左下角来取消和灵活的右下角来完成按钮。
-
@Desdenova。就是这样:self.cancelButton.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin;self.nextButtonView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleLeftMargin;
标签: ios objective-c uilabel