Closed ToninZhao closed 8 years ago
要么纯代码,要么纯xib或sb。
简直作死!乖乖听楼上的话
既然是研究新布局,为嘛不尝试.再说用frame设置完全正常,sd布局有问题,要找原因,不是规避问题
可以约束xib生成的控件的,把你有问题的demo发我邮箱看下 gsdios@126.com
找到问题了,如果父view是代码写的,用sd布局xib子控件,要主动调[self layoutIfNeeded]; [self layoutSubviews];方法,否则布局无效
我看了你的demo,布局代码不要写在layoutSubviews方法里面,写在初始化方法里面,约束设置一次即可,不用手动调用layoutSubviews方法的
同时在父view中,布局xib子控件和代码生成的子控件,布局无效