Use Xib trying not need to set custom constraints make adaptive control different screens

2791865-20da79a6a3560345.jpg
ChMkJ1bKxpSIOrkvAAWAc1mZkZkAALHnQJNGk4ABYCL317.jpg

Today we have to talk about with xib custom when trying on different adaptive constraint on the size of the phone, in fact, we just need to give us NSLayoutConstraint write a classified able to complete this looks very complicated things.
I uploaded the code to github above, you can download the code directly into your project which can then pleasant to use.
Specific use steps:
1, first find our view
2791865-65ae99ee6588173f.jpg
1559614273679.jpg

2, then pay attention to see us find the constraints set
2791865-1792640910957d60.jpg
1559614916186.jpg

3, find the third step of selecting one of the
2791865-a3714e590647ab40.jpg
1559615063871.jpg

4, pay attention to where Adapter Screen
we want this elected ON
2791865-8367add6211d1d4c.jpg
1559615154677.jpg

5, everything somehow But be careful here (all of this is bound to be all on , all), which is more annoying that we must pay attention.
2791865-31897e0304886d41.png
image.png

Code address
https://github.com/ryanranya/DisConstraint
like friends want to help point stars, thanks! ! !

Guess you like

Origin blog.csdn.net/weixin_34292402/article/details/90801564