简体   繁体   中英

Resizing content in a UIScrollView

I am creating a scrollview programmatically and adding subviews to it programmatically. The subviews are created programmatically as well.

I am just wondering how to rotate / resize the subview so that it remains visible in landscape mode.

I have set the scrollview to autorotateSubviews:YES and in my subview i have set the mask to be flexiblewidth|flexibleheight is this correct?

I am used to doing this in IB with the springs and struts section of the inspector.

Thanks

Your scroll view is probably contained in a view witha corresponding controller that receives willAnimateRotationToInterfaceOrientation:duration: and didRotateFromInterfaceOrientation: notifications. Use these opportunities to resize the subviews of the scrollview.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM