UIScrollView in ScrollView - ScrollBars not showing

backstory

I am writing an ipad application that has images that scroll horizontally using a UIScrollView. It works great. Now for each image I need to have a UIScrollView that has some kind of text explaining the image. This will be a vertical scrollView. A vertical ScrollView will appear, but then the scrollbars will not appear. Any idea why? Code below:

CGRect scrollViewFrame = CGRectMake(760, 70, 205, 320);
UIScrollView * contentScrollView = [[UIScrollView alloc]initWithFrame:scrollViewFrame];
[contentView addSubview:contentScrollView];
CGSize scrollViewContentSize = CGSizeMake(205, 100);
[contentScrollView setContentSize:scrollViewContentSize];
[contentScrollView setPagingEnabled:YES];
contentScrollView.delegate = self;

UILabel *titleLable = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 205, 40)];
UILabel *subtitleLable = [[UILabel alloc] initWithFrame:CGRectMake(10, 60, 205, 50)];
UITextView * mainContent = [[UITextView alloc]initWithFrame:CGRectMake(10, 110, 205, 230)];

[titleLable setText:storyTitle];
[subtitleLable setText:storySubTitle];
[contentView setUserInteractionEnabled:YES];
[mainContent setText:storyDescription];

Also, the main scrolView has already been added using Interface Builder and is working fine. Does anyone know why this is happening?

+1
source share
1 answer

, , , , (205, 320), - (205, 100).

+4

All Articles