scrollView

    

    //        scrollView.contentSize = CGSizeMake(self.view.frame.size.width * 10, self.view.frame.size.height);

    //        [self.view addSubview:scrollView];

    //        scrollView.delegate = self;

    //        scrollView.pagingEnabled = YES;

    //        scrollView.showsHorizontalScrollIndicator = NO;

    //        for (int i = 0; i < 10; i++) {

    //            UIImage *image = [UIImage imageNamed:@"Default"];

    //            UIImageView *imageView = [[UIImageView alloc] initWithImage:image];

    //            imageView.frame = CGRectMake(self.view.frame.size.width * i, 0, self.view.frame.size.width, self.view.frame.size.height);

    //            [scrollView addSubview:imageView];


    scrollView.contentSize = CGSizeMake(self.view.frame.size.width * 2, self.view.frame.size.height);

    [self.view addSubview:scrollView];

    scrollView.delegate = self;

    scrollView.pagingEnabled = YES;

    scrollView.showsHorizontalScrollIndicator = NO;

    

    viewOne.frame = CGRectMake(self.view.frame.size.width * 0, 0, self.view.frame.size.width, self.view.frame.size.height);

    [scrollView addSubview:viewOne];

    

    viewTwo.frame = CGRectMake(self.view.frame.size.width * 1, 0, self.view.frame.size.width, self.view.frame.size.height);

    [scrollView addSubview:viewOne];

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页