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];
        
        
    }
  • 相关阅读:
    原型链与析构函数
    django篇-路由系统介绍
    mvc与mtv
    模板初探
    安装和创建django项目
    一分钟学会定时删除日志的 Shell 脚本
    svn其中一种备份方式svnsync
    mysql企业实战(二)之主从复制,读写分离,双主,以及高可用
    mysql企业实战(一)
    nginx详解
  • 原文地址:https://www.cnblogs.com/neozhu/p/2552039.html
Copyright © 2011-2022 走看看