首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >关于IOS UIScrollView Sliding automatic将反弹

关于IOS UIScrollView Sliding automatic将反弹
EN

Stack Overflow用户
提问于 2013-04-10 16:26:24
回答 1查看 202关注 0票数 0

我的应用程序的UIScrollView滑动自动恢复,我能做什么?我不想要!

我的代码如下:

代码语言:javascript
复制
- (void)initScrollView {
    // a page is the width of the scroll view 
        sv = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 96, 320, 300)];
        sv.contentSize = CGSizeMake(sv.frame.size.width * 3, sv.frame.size.height* 2);
        sv.pagingEnabled = YES;
        sv.clipsToBounds = YES;
        sv.showsHorizontalScrollIndicator = NO;
        sv.showsVerticalScrollIndicator = YES;
        sv.scrollsToTop = NO;
        sv.directionalLockEnabled = YES;
        sv.delegate = self;
        [self.view addSubview:sv];

        currentPage = 0;
        pageControl.numberOfPages = 3;
        pageControl.currentPage = 0;
        pageControl.backgroundColor = [UIColor clearColor];
        [self createAllEmptyPagesForScrollView];
}
- (void)createAllEmptyPagesForScrollView {

    tapView1 = [[UIView alloc]init];
    tapView1.backgroundColor = [UIColor clearColor];
    tapView1.frame = CGRectMake(320*0, 0, 320, sv.frame.size.height);

    tapView2 = [[UIView alloc]init];
    tapView2.backgroundColor = [UIColor clearColor];
    tapView2.frame = CGRectMake(320*1, 0, 320, sv.frame.size.height);

    tapView3 = [[UIView alloc]init];
    tapView3.backgroundColor = [UIColor clearColor];
    tapView3.frame = CGRectMake(320*2, 0, 320, sv.frame.size.height);

    [sv addSubview:tapView1];
    [sv addSubview:tapView2];
    [sv addSubview:tapView3];
}
EN

回答 1

Stack Overflow用户

发布于 2013-04-10 21:57:15

我知道为什么我滑起来自动弹回来了,我的代码有问题!不是bove代码!谢谢大家!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15920646

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档