zoukankan      html  css  js  c++  java
  • iOS--创建uiscrollview

    //创建uiscrollview
        self.PageHeight = self.view.bounds.size.height;
        self.PageWidth = self.view.bounds.size.width;
        
        self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.PageWidth, self.PageHeight)];
    
    self.scrollView.backgroundColor = [UIColor colorWithRed:61/255.0 green:61/255.0 blue:61/255.0 alpha:1];
    
    [self.view addSubview:self.scrollView];
        self.scrollView.contentSize = CGSizeMake(self.PageWidth*self.FirstLayList.count,self.PageHeight);
        self.scrollView.contentOffset = CGPointMake(0, 0);
        self.scrollView.pagingEnabled = YES;
        
        //加载服务
        self.scrollView.delegate = self;
    
    
    //完成拖拽
    - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{
        NSLog(@"完成拖拽");
        NSInteger juli = scrollView.contentSize.width-_PageWidth-1;
        if (scrollView.contentOffset.x >juli) {
            OldListViewController *oldlist = [self.storyboard instantiateViewControllerWithIdentifier:@"oldlist"];
            [self.navigationController pushViewController:oldlist animated:YES];
        }
    }
  • 相关阅读:
    WordCount
    vs2013安装及测试
    阅读程序,回答问题
    补作业:随机生成二元四则运算
    第一次合作
    漫漫“码农”路
    我的进度条
    Believe
    软件工程个人总结
    结队作业——电梯调度程序
  • 原文地址:https://www.cnblogs.com/qiyiyifan/p/6265906.html
Copyright © 2011-2022 走看看