[英]Simulator IPad pro (works) vs iPhone 6 plus
I have my mobile app in Objective C. I have a scroll view page. 我在Objective C中有移动应用程序。我有一个滚动视图页面。 In Simulator iPad Pro it works.
在Simulator iPad Pro中可以使用。 In Simulator iPhone 6 Plus, the scroll view starts at lower part of page and I cannot get it back up to top.
在Simulator iPhone 6 Plus中,滚动视图从页面下部开始,我无法将其重新回到顶部。 In fact all of the iPhone ( 5,6,7) look like the iPhone 6 plus.ie the top of the page shows "Grade" and "County".
实际上,所有的iPhone(5、6、7)看起来都像iPhone 6 plus.ie,即页面顶部显示“ Grade”和“ County”。 I cannot scroll up to see "First Name".
我无法向上滚动以查看“名字”。 The only thing I am changing is the device.
我唯一要更改的是设备。
Suggestions? 有什么建议吗?
below is iPhone 6 Plus 以下是iPhone 6 Plus
SOLVED- During trying all several options, I forgot I had: 已解决-在尝试所有几种选择时,我忘记了:
-(void)viewDidLayoutSubviews{
[super viewDidLayoutSubviews];
// REMOVE the LINES BELOW
[self.scroller layoutIfNeeded];
self.scroller.contentSize = self.contentView.bounds.size;
self.contentView.center = self.view.superview.center;
} }
After removing the 3 lines above, it worked correctly in iPhone 5, 6, 7. The IPad worked WITH or WITHOUT those 3 lines. 删除上面的3行后,它可以在iPhone 5、6、7中正常工作。iPad可以使用或不使用这3行。 I spent a lot of time on this.
我花了很多时间。 I hope this helps others.
我希望这对其他人有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.