简体   繁体   中英

Simulator IPad pro (works) vs iPhone 6 plus

I have my mobile app in Objective C. I have a scroll view page. In Simulator iPad Pro it works. In Simulator iPhone 6 Plus, the scroll view starts at lower part of page and I cannot get it back up to top. 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". 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加

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. 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 ?

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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