0

我想在没有帮助的情况下放置滚动条,xib并且我正在使用这段代码,但是当我添加级别或任何内容时。

    UIScrollView *scrollView = [[UIScrollView alloc]initWithFrame:self.view.frame];
    scrollView.contentSize   = CGSizeMake(1947, 1800);
    scrollView.showsHorizontalScrollIndicator=YES;
    scrollView.showsVerticalScrollIndicator=YES;
    // [imageView release];
    [self.view addSubview:scrollView];
4

1 回答 1

0

我完全不明白你的问题。这可以帮助你。

    UIScrollView *scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0.0, 0.0,1024,668)];
    scrollView.contentSize = CGSizeMake(1024,768);
    scrollView.delegate = self;
    scrollView.pagingEnabled = YES;
    scrollView.showsHorizontalScrollIndicator = YES;
    scrollView.showsVerticalScrollIndicator =YES;
    scrollView.alwaysBounceHorizontal = YES;
    scrollView.delaysContentTouches = NO;
    scrollView.canCancelContentTouches = NO;
    scrollView.bounces = YES;
    scrollView.bouncesZoom = YES;
    scrollView.scrollEnabled = YES;
    scrollView.directionalLockEnabled = YES;
    scrollView.minimumZoomScale = 0.5;
    scrollView.maximumZoomScale = 5.0;
    scrollView.scrollsToTop = YES;
    scrollView.backgroundColor=[UIColor clearColor];
    [self.view addSubview:scrollView];
于 2013-09-13T05:18:11.423 回答