iOS ipad and iphone xib between the matching all screens

Source: Internet
Author: User
Tags compact

Today in the project shipped to this question, is in the original xib is suitable for all the iphone screen, but now it is necessary to adapt to the iphone also to adapt to the ipad, make a very big, now in order to achieve this effect, the boss gave me two ways, is on the basis of xib modified, Directly on the code, not much to say.

The first way: Modify the Xib file (source code)

1. This thing will appear in the xib of the screen that fits all iphone:

<variation key= "Default" >

<mask key= "Subviews" >

<exclude reference= "Odz-pl-lf9"/>

</mask>

<mask key= "Constraints" >

<exclude reference= "C4C-3V-HBQ"/>

<exclude reference= "au7-kx-z5f"/>

</mask>

</variation>

<variation key= "Heightclass=regular-widthclass=compact" >

<mask key= "Subviews" >

<include reference= "Odz-pl-lf9"/>

</mask>

<mask key= "Constraints" >

<include reference= "C4C-3V-HBQ"/>

<include reference= "au7-kx-z5f"/>

</mask>

</variation>

Replace All "Heightclass=regular-widthclass=compact" with "Default", and you can change the Any-any screen to fit.

The effect before is on the iphone's adaptation effect:

The effect of modifying the screen after Any-any:

The second way: more cumbersome, it is recommended not to use this method: (Check this control, and then choose Any-any) The iphone screen to delete things can be::

The corresponding constraints also need to be, make the same changes, can also achieve the same effect::

Finally, this effect can be achieved, hoping to help people in need:

iOS ipad and iphone xib between the matching all screens

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.