简体   繁体   中英

Add UIScrollView to UIViewController

I am trying to add a UIScrollView to an existing UIViewController (with navigation and tab bar) using storyboard and autolayout but I don't get this to work. Up to now I have added all components to the controller by dragging them on it. Now I try to group them in a UIView, so that I can make this UIView a subview of UIScrollView. When I drag my existing components as a subview of my newly created UIView the position of it is wrong. So I must manually correct all positions. Afterwards the compoents are 64px below their old position.

I just cant get it to work. Is there a tutorial or something how to add an UIScrollView to an existing storyboard?

This is the easiest way to learn how to control a UIScrollViewer within a Storyboard.

http://agilewarrior.wordpress.com/2012/05/18/uiscrollview-examples/

You might want to deselect Ajust Scroll View Insets in interface builder.

You can also set in your viewDidLoad :

self.automaticallyAdjustsScrollViewInsets = NO;

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