user2489946
user2489946

Reputation: 291

UIScrollView Cutting off lables at the top of the screen

I am displaying multiple labels inside a UIScrollView, I can get them to display and I can get them to scroll, but a label at the top of the screen is cut off and is not visible unless you pull down. I have a tried adjusting the UIScrollViews content size, frame etc. all to no avail. Please help! Code:

    [self.view addSubview: scrollView];
    scrollView.scrollEnabled = YES;
    int scrollWidth = 120;
    int scrollHeight = 1000;
    scrollView.contentSize = CGSizeMake(scrollWidth,scrollHeight);
    scrollView.frame = CGRectMake(0, 0, 320, 400);

Upvotes: 1

Views: 626

Answers (1)

Apurv
Apurv

Reputation: 17186

Set the contentOffset to (0,0).

Upvotes: 1

Related Questions