IOS control size and position adjustment

Source: Internet
Author: User

Controls. Autorisizingmask for setting control dimensions and position

The Autoresizessubviews property indicates whether the control is automatically adjusted for position, by default Yes (allows automatic adjustment), such as setting the No,autoresizingmask property to be effective

Uiviewautoresizingnone

Control will not be automatically resized, the effect

Uiviewautoresizingflexibleheight

The height of the control changes proportionally to the height of the parent view. Otherwise, the view's height will remain unchanged.

Uiviewautoresizingflexiblewidth

The width of the control changes proportionally with the width of the parent view. Otherwise, the width of the view remains the same.

Uiviewautoresizingflexibleleftmargin

The left border of the control adjusts proportionally as the parent view width changes. Otherwise, the relative position of the control and its parent view's left edge remains the same.

Uiviewautoresizingflexiblerightmargin

The right border of the control adjusts proportionally as the width of the parent view changes. Otherwise, the relative position of the control and its parent view's right edge remains the same.

Uiviewautoresizingflexiblebottommargin

The bottom boundary of the control adjusts proportionally as the height of the parent view changes. Otherwise, the relative position of the control and its parent view's bottom boundary remains the same.

Uiviewautoresizingflexibletopmargin

The top bounds of the control adjust proportionally as the parent view height changes. Otherwise, the relative position of the top edge of the control and its parent view remains the same.

Set Multiple values

View.autoresizingmask = Uiviewautoresizingflexibleleftmargin | Uiviewautoresizingflexiblerightmargin;

Note: If there are multiple values, the "|" Association

IOS control size and position adjustment

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.