引入xib文件UIView改变frame无效

有时候我们不想用代码布局某个视图时,例如tableview的sectionHeaderView,我们往往会新建一个xib文件来实现布局,但是如果在xib中默认的大小为200*200,当我们把视图加载到UIViewController中,手动更改frame无效,多半原因是因为这个xib文件引用了autoLayout,解决方式就是选中xib中的UIView,关闭xib的autolayout,如下图所示即可自己设置frame。

猜你喜欢

转载自blog.csdn.net/lidongxuedecsdn/article/details/81203895