美文网首页
正版滚动

正版滚动

作者: 0bf43b438419 | 来源:发表于2019-04-30 10:36 被阅读0次

    UIScrollView *sc =[[UIScrollView alloc] initWithFrame:CGRectMake(0, 67, self.view.frame.size.width, 200)];
        sc.showsVerticalScrollIndicator= NO;
        self.view.backgroundColor = [UIColor whiteColor];
        sc.showsHorizontalScrollIndicator = NO;
        sc.contentSize = CGSizeMake(self.view.frame.size.width *3 , 0);
        sc.pagingEnabled = YES;
        sc.userInteractionEnabled = YES;
        [self.view addSubview:sc];
        for (int i = 0; i<3; i++) {
            UIImageView *img =[[UIImageView alloc] initWithFrame:CGRectMake(self.view.frame.size.width * i,0 , self.view.frame.size.width , 200)];
            NSArray *arr =[NSArray arrayWithObjects:@"1",@"2",@"3", nil];
            img.image =[UIImage imageNamed:arr[i]];
            [sc addSubview:img];
             
    }

    相关文章

      网友评论

          本文标题:正版滚动

          本文链接:https://www.haomeiwen.com/subject/vusmnqtx.html