滚动视图不会滚动并在底部创建空白区域

时间:2014-02-26 05:56:50

标签: ios uiscrollview ios-simulator scrollview

我的UIViewController设置了一个滚动视图,并且滚动视图中有许多项目在线并从Parse中提取一些信息,但是当我运行模拟器并转到该页面时,视图不可滚动而且我在视图的底部获得这个奇怪的空白区域。

Scroll View中的内容大于Scroll View,在Attributes Inspector中我将Scroll View视为“Scrolling Enabled”(你可以在图片中看到它),任何帮助都会非常感激!

这是显示空白区域的图像以及我如何设置滚动视图和属性检查器

enter image description here

viewDidLoad中,我有:

self.title = promoDetail.shortName; 
UIBarButtonItem *backButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Previous" style:UIBarButtonItemStylePlain target:nil action:nil]; 
self.navigationItem.backBarButtonItem = backButtonItem; 
self.imageDetail.file = promoDetail.Image; 
self.percentDetail.text = [NSString stringWithFormat:@"%@", promoDetail.percent]; ; self.termsDetail.text = promoDetail.terms; 
self.detailsDetail.text = promoDetail.details; // Do any additional setup after loading the view. 
[self.scrollView setDelegate:self]; 

1 个答案:

答案 0 :(得分:1)

您可能会遗漏两件事 的 1。为什么没有启用滚动 并且:检查内容大小

<强> 2。为什么屏幕底部有空白区域 并且:你能否在你的项目故事板中查看视图的高度,是480还是586,如果它是480,则表示你在iPhone 4英寸运行应用程序时选择了iPhone 3.5英寸UIView。

相关问题