zoukankan      html  css  js  c++  java
  • Infinite Scrolling in UIScrollView

    - (void)viewDidLoad
    {
        [super viewDidLoad];
        
        [theScrollView setContentSize:CGSizeMake(3 * theScrollView.bounds.size.width, theScrollView.bounds.size.height)];
        [theScrollView setPagingEnabled:YES];
        
        CGRect aFrame = theScrollView.bounds;
        
        UIView* view;
        NSLog(@"Frame: %@", NSStringFromCGRect(aFrame));
        view = [[UIView alloc] initWithFrame:aFrame];
        [view setBackgroundColor:[UIColor blueColor]];
        [theScrollView addSubview:view];
        
        aFrame = CGRectOffset(aFrame, theScrollView.bounds.size.width, 0);
        NSLog(@"Frame: %@", NSStringFromCGRect(aFrame));
        view = [[UIView alloc] initWithFrame:aFrame];
        [view setBackgroundColor:[UIColor redColor]];
        [theScrollView addSubview:view];
            
        aFrame = CGRectOffset(aFrame, theScrollView.bounds.size.width, 0);
        NSLog(@"Frame: %@", NSStringFromCGRect(aFrame));
        view = [[UIView alloc] initWithFrame:aFrame];
        [view setBackgroundColor:[UIColor yellowColor]];
        [theScrollView addSubview:view];
        
        
    }
  • 相关阅读:
    cf 535 A. Tavas and Nafas
    codeforces 534 A. Exam
    hust新人赛模拟 20150407 H
    hust新人赛模拟20150407 F
    hust新人赛模拟20150407 C
    hust新人赛模拟20150407 A
    [dp专题]hdu 1160 FatMouse's Speed
    [dp专题]hdu 1260 tickets
    [dp专题]G免费馅饼
    迷宫问题(bfs+记录路径)
  • 原文地址:https://www.cnblogs.com/neozhu/p/2552039.html
Copyright © 2011-2022 走看看