ios - Enable stretch layout option to support bigger iPhones -


our current version of our iphone application in app store stretches layout fill iphone 6 , 6+. after xcode 7 update, app runs on iphone 4 black bars @ top. understand adding launch storyboard resolves this. problem our layout out of whack on 6 , 6+.

obviously fixing layout adapt these screen sizes needs done, in pinch , need behind scenes function update pushed out our users asap. there anyway go old behavior uiview stretch fill screens?

this won't immediate fix, it's quick patch might worth trying.

if view in portrait, should work you. if requires rotating or uisplitviewcontroller on iphone 6(s)+, might not.

scale each subview in view controller new screen size. declare couple macros device screen size:

#define kscreenwidth  [uiscreen mainscreen].bounds.size.width #define kscreenheight [uiscreen mainscreen].bounds.size.height 

then add method view controllers goes through subviews resize each view proportionately based on iphone 4 screen size.

- (void)resizesubviews:(uiview *)view {     cgrect frame = view.frame;     frame.origin.x = frame.origin.x / 320.0f * kscreenwidth;     frame.origin.y = frame.origin.y / 480.0f * kscreenheight;     frame.size.width = frame.size.width / 320.0f * kscreenwidth;     frame.size.height = frame.size.height / 480.0f * kscreenheight;     view.frame = frame;      (uiview *subview in view.subviews) {         [self resizesubviews:subview];     } } 

then call method after adding subviews with:

[self resizesubviews:self.view]; 

there lot of ways not work, covered me during switch iphone 4s iphone 5.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -