【发布时间】:2010-12-29 00:19:58
【问题描述】:
我将一个圆角矩形按钮放入表格视图页脚。
但是无论我如何更改 BUTTON_WIDTH,按钮都会向左和向右拉伸。但它的高度是可调的。
有什么问题?下面是我使用的代码。
#define BUTTON_WIDTH 80
#define BUTTON_HEIGHT 45
- (void)viewDidLoad {
CGRect frame = CGRectMake(0, 0, BUTTON_WIDTH, BUTTON_HEIGHT);
// btnSeeResult is decleared in header file
btnSeeResult = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[btnSeeResult setTitle:@"Result" forState:UIControlStateNormal];
[btnSeeResult addTarget:self action:@selector(seeResult) forControlEvents:UIControlEventTouchUpInside];
btnSeeResult.frame = frame;
self.tableView.tableFooterView = btnSeeResult;
}
【问题讨论】: