iOS Development-autoresizingmask

Source: Internet
Author: User

Autoresizingmask properties for controls on iOSSome results of personal testing

Adaptive Setautoresizingmask Controls



       uiviewautoresizingnone                         =  0

      uiviewautoresizingflexib leleftmargin &NBSP;  =  1  <<  0

      uiviewautoresizingflexib lewidth&NBSP;           =  1  <<  1

      uiviewautoresizingflexib lerightmargin&NBSP;  =  1  <<  2

      uiviewautoresizingflexib letopmargin&NBSP;     =  1  <<  3

      uiviewautoresizingflexib leheight &NBSP;        =  1  <<  4

      uiviewautoresizingflexib lebottommargin =  1  <<  5


Uiviewautoresizingnone


uilabel *      label = [[uilabel   alloc ]  initwithframe : cgrectmake (50 ,  < Span style= "word-wrap:normal; Word-break:normal ">100 ,  200 ,  40 )];

[Label setautoresizingmask: uiviewautoresizingnone]; Control does not change relative to top view coordinate values


cgrectmake (50 ,   100 ,   200 ,   40 )
uiviewautoresizingflexiblewidth: The width of the control changes proportionally with the width of the parent view, for example
the width of the label width is 480 when the screen width is label width changed to 100*480/320 Similarlyuiviewautoresizingflexibleheight same

uiviewautoresizingflexibleleftmargin The distance to the left of the screenchanges proportionally with the width of the parent view
for Example< Span style= "word-wrap:normal; Word-break:normal; line-height:21px; Color:rgb (40,50,207) ">cgrectmake (50 ,   100 ,   200 ,   40 )];     50        width of the screen is               when the screen width is 480         label width   change to   50*480/320 control changed to      cgrectmake (75,  100 ,   200 ,   40 )];  
uiviewautoresizingflexiblerightmarginuiviewautoresizingflexibletopmarginuiviewautoresizingflexiblebottommargin

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

iOS Development-autoresizingmask

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.