ios - xib约束问题,求解决!!!
高洛峰
高洛峰 2017-04-17 17:42:20
0
4
379


问:
1.如何让模块定位在xib的view上面的25%的位置?只能用代码来约束吗???
2.xib的视图的宽度是320,如果添加到6p上面,怎样才能做到适配屏幕的全宽度?也是只能用用代码来约束吗???

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(4)
大家讲道理

It can be completed with just one constraint and can be adapted to any screen size. Other constraints are designed to allow the control to change proportionally, and can also be set to fixed.

阿神

For xib, use Aspect Ratio to set the height ratio, which means the layout is a little rounded, and autolayout and size class are used to automatically adapt to the full screen.
If you use code constraints, it is recommended to use some better layout frameworks such as Masonry, which is very convenient .

PHPzhong

First of all, I have been thinking about these issues recently, so I paid attention to this.

Based on your question, I can give you a general direction, that is, when performing autoLayout on xib, you can select the proportion. Using this method, you can completely achieve the effect you want to achieve. As for the specific implementation method, I'm still researching.

I wish you can solve it as soon as possible and share it with me later

PHPzhong

Try Aspect Ratio.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template