【发布时间】:2011-01-02 09:50:03
【问题描述】:
我正在以编程方式将 UIButton 添加到 tableView 页脚。这个按钮的左右边距等于 tableView 边距:
UIButton *deleteButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
deleteButton.frame = CGRectMake(10, 60, 300, 34);
deleteButton.autoresizingMask = UIViewAutoresizingFlexibleWidth
我添加 autoresizingMask 是因为我想支持旋转。但是,它不能按我的意愿工作,因为按钮一直向右延伸,如下图所示。
知道如何解决吗?如果我删除 autosizing 属性,那么边距是正确的。
【问题讨论】:
标签: iphone cocoa-touch uitableview