objective c - Mysterious phenomenon on iPad with iOS 8 -
my app designed work in portrait , landscape orientations. if app launched while device hold in portrait, works fine. , can change orientation landscape, working fine.
but when app first launched in landscape, nothing works.
all things placed correctly, touch events recognized in left part of display. 2 buttons on top right not working.
in state, device rotated portrait, display unusable:
original screenshot! happens ipad , ios 8.x. old ipad 1 , ios 5.1.1 works perfectly.
sure, bug in ios 8.0. can do?
try this
-(void)viewwillappearanimated:(bool)animated{ [super viewwillappearanimated:animated]; bool landscape = uiinterfaceorientationislandscape([[uiapplication sharedapplication]statusbarorientation]); bool ios8 = nsclassfromstring(@"uipopoverpresentationcontroller")!=null; if (landscape&&ios8) { nslog(@"launch in landscape orientation problem!!"); //if handle rotation programatically should it.. [self willrotatetointerfaceorientation:[[uiapplication sharedapplication]statusbarorientation] duration:0.0]; //or if use autolayout.. cgrect rct = cgrectzero; rct.size.width = (cgfloat) fmaxf(((float)[[uiscreen mainscreen]bounds].size.height),((float)[[uiscreen mainscreen]bounds].size.width)); rct.size.height = (cgfloat) fminf(((float)[[uiscreen mainscreen]bounds].size.height),((float)[[uiscreen mainscreen]bounds].size.width)); [self.view setframe:rct]; } }
Comments
Post a Comment