简体   繁体   English

模拟器iPad Pro(适用)与iPhone 6 Plus

[英]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? 有什么建议吗?

iPad Pro

below is iPhone 6 Plus 以下是iPhone 6 Plus

iPhone 6加

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. 我希望这对其他人有帮助。

are you using Constraints to setup your views? 您是否正在使用约束来设置视图? if so then try checking scrollview's top constraint whether its linked to Top Layout Guide's bottom ? 如果是这样,则尝试检查scrollview的顶部约束是否链接到《顶部布局指南》的底部?

在此处输入图片说明

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

相关问题 在iPhone 6和iPad Pro Simulator上运行时,黑条显示在顶部 - Black bar appears on top when running on iPhone 6 & iPad Pro Simulator 在iPhone 7的模拟器上加载了贴纸包扩展程序,但在7+或iPad Pro上却没有? - Sticker pack extension loading on simulator on iPhone 7, but not 7+ or iPad pro? 应用程序可在iPhone上运行,但在iPad模拟器上崩溃,并停留在ipad上的启动图像上 - App works on iPhone but crash on iPad simulator stuck with launch image on ipad UICollectionView-iOS 10-在iPhone 6 Plus模拟器上崩溃但可在真实设备上运行 - UICollectionView - iOS 10 - crash on iPhone 6 Plus simulator but works on real device 有没有办法将我的iOS模拟器应用程序数据从一个模拟器(iPhone 7)移动到另一个模拟器(iPad Pro 12.9)? - Is there a way to move my iOS Simulator app data from one simulator (iPhone 7) to another (iPad Pro 12.9)? 优化最新的iPad Pro Simulator - Optimization for newest iPad Pro Simulator 在xcode / simulator中启用iPad Pro - enabling iPad pro in xcode/simulator 该应用程序在iPhone上运行良好; iPad模拟器仅提供黑屏 - app works fine on iPhone; iPad simulator gives only black screen iPad模拟器出错,但iPhone出现错误 - Error in simulator for iPad but not for iPhone AVExportSession可在Simulator,iPad 2而非iPad 4上运行 - AVExportSession works on Simulator, iPad 2 but not iPad 4
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM