简体   繁体   English

另一个UIScrollView不滚动

[英]another UIScrollView doesn't scroll

First of the bat: I am aware of the fact, that thsi question was asked and answered several times here, but none of the answers worked for me so far. 首先,我知道一个事实,在这里我曾多次问过这个问题,但到目前为止,没有一个答案对我有用。

So here's the deal I have a scrollView with multiple labels, images other stuff in my view. 所以这是我有一个带有多个标签的scrollView,可以在视图中显示其他内容的协议。 See the image. 看到图像。 I have hooked it up to my code and believe, that I have also initialized it properly in my implementation. 我已经将其连接到我的代码并相信,我也已在实现中对其进行了正确的初始化。 What am I doing wrong? 我究竟做错了什么? iOS6 btw. iOS6顺便说一句。

since I can't post images yet, I uploaded it here: http://oliverengelhardt.de/uploads/scrollViewOne.png 由于无法发布图片,因此我将其上传到了这里: http : //oliverengelhardt.de/uploads/scrollViewOne.png

and the implementation code: 和实现代码:

@synthesize scrollView;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [scrollView setScrollEnabled:TRUE];
    [scrollView setContentSize:CGSizeMake(320, 713)];

You seem to have made the content size of the scroll view in code the same size as its frame is in IB. 您似乎已使代码中滚动视图的内容大小与IB中其框架的大小相同。 It will only scroll if the content is larger than the frame. 仅当内容大于框架时,它才会滚动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM