0
votes

I have the following setup:

On top of a UIViewController I've set a UIScrollView with size 320 x 56. Inside the UIScrollView I have a UIView with size 640 x 56. The UIScrollView has the autoresize prop uncheked and it's scrollable horizontally only..

So in the viewDidLoad method I set the contentSize to the IOutlet of the UIScrollView. I set it as 640 x 56. Also the delegate to the UIScrollView is set in this method.

- (void)viewDidLoad {
    [super viewDidLoad];
    self.scrollView.contentSize = CGSize(640, 56);
}

The problem is that I can't get the control to scroll. Also I nslog the bounds and frame of the UIScrollView and UIView and both are set to 0,0 when the methods viewDidLoad and viewWillAppear are called. Not sure what I'm missing here.

The idea is to be able to have the UIView scroll to the sides and show the controls that are embedded.

I've tried many suggestions found in diff post and can't make this to work. Help is appreciated!!!

Thanks

1
are you creating the scrollView in the Interface builder? If so, do you have the IBOutlet connected to your NIB?Ondrej Rafaj
IBOulet is connected, yes. I have an IBOulet for the UIScrollView and one for the IUView. For the IUView I just wanted to nslog its properties.user1791567
can you post here nslogs for the scrollview size, view size and scrollview content offset ... get the values on viewDidAppearOndrej Rafaj

1 Answers

0
votes

I was able to get this to work by unchecking the Autolayout option. Also the contentSize was the only property for the scrollView set in the viewDidLoad.

Thanks