iOS 8 tableveiw 自动布局

来源:互联网 发布:软件的点击广告 编辑:程序博客网 时间:2024/06/05 03:04

Autolayout调整frame后,会自动拉伸和收缩SupView。

在TableViewController里

- (void)viewDidLoad {

    [super viewDidLoad];

    

//添加这两行代码

    self.tableView.estimatedRowHeight = 44.0f;

    self.tableView.rowHeight = UITableViewAutomaticDimension;

}

自动布局搞定
0 0