iOS: Can you set up a ScrollView under IB?
Can't seem to find a good tutorial for ScrollView so I've been trying to set it up myself using IB - is this even possible?
I've added a scrollview to a ViewController, sized it to 640x200, added a view at the same size with 2 labels at each end开发者_高级运维. Created an outlet and linked it up to Files Owner, but when I run I see the first label but it won't scroll. Basically I'm trying to create a half-height horizontal scroller to show a number of buttons, but I can't even get it moving.
Little help?
Thanks
I´ve never managed to get desired results for the scroll view using IB. These two lines always do the trick:
[mainScrollView setFrame:CGRectMake(0, 0, 320, 700)];
[mainScrollView setContentSize:CGSizeMake(320,1200)];
As far as I know there is no way to set the contentSize
in IB. So set it in viewDidLoad
method of your view controller.
[myScrollView setContentSize:CGSizeMake(640,200)];
精彩评论