Adding the scrollview created by photoscroller to a subview

Posted by wierddemon on Stack Overflow See other posts from Stack Overflow or by wierddemon
Published on 2012-06-23T22:18:26Z Indexed on 2012/06/24 3:16 UTC
Read the original article Hit count: 115

Filed under:
|
|
|
|

I'm trying to modify Apple's PhotoScroller example to make the scrollview that is created into a subview instead of it being a view that takes up the entire screen. Any ideas on how this can be accomplished?

- (void)loadView 
{    
    // Step 1: make the outer paging scroll view
    CGRect pagingScrollViewFrame = [self frameForPagingScrollView];
    pagingScrollView = [[UIScrollView alloc] initWithFrame:pagingScrollViewFrame];
    pagingScrollView.pagingEnabled = YES;
    pagingScrollView.backgroundColor = [UIColor blackColor];
    pagingScrollView.showsVerticalScrollIndicator = NO;
    pagingScrollView.showsHorizontalScrollIndicator = NO;
    pagingScrollView.contentSize = [self contentSizeForPagingScrollView];
    pagingScrollView.delegate = self;

    // When I do this it fails
    [self.view addSubview:pagingScrollView];

    // Step 2: prepare to tile content
    recycledPages = [[NSMutableSet alloc] init];
    visiblePages  = [[NSMutableSet alloc] init];
    [self tilePages];
}

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c