objective c - iphone 5 retina 4 inch mapview -
i'm trying adapt app retina 4 screen iphone 5, , adding png archive , resizes map view, moves top , leaves white square on bottom. i'd know how fix it.
thanks in advance.

maybe has it?
- (void)willanimaterotationtointerfaceorientation:(uiinterfaceorientation)tointerfaceorientation duration:(nstimeinterval)duration { if (ui_user_interface_idiom() == uiuserinterfaceidiompad) { // need manually handle rotation on ipads running ios 5 , higher support new uinavigationbar customization. automatic on iphone & ipod touch. if ([self.navigationcontroller.navigationbar respondstoselector:@selector(setbackgroundimage:forbarmetrics:)] ) { if (tointerfaceorientation == uiinterfaceorientationlandscapeleft || tointerfaceorientation == uiinterfaceorientationlandscaperight) { [self.navigationcontroller.navigationbar setbackgroundimage:[uiimage imagenamed:@"uinavbarlandscape@ipad.png"] forbarmetrics:uibarmetricsdefault]; } else { [self.navigationcontroller.navigationbar setbackgroundimage:[uiimage imagenamed:@"uinavbar@ipad.png"] forbarmetrics:uibarmetricsdefault]; } } } else { if (tointerfaceorientation == uiinterfaceorientationlandscapeleft || tointerfaceorientation == uiinterfaceorientationlandscaperight) { [mapview setframe:cgrectmake(0, 0, 480, 236)]; [toolbar setframe:cgrectmake(0, 236, 480, 32)]; } else { [mapview setframe:cgrectmake(0, 0, 320, 372)]; [toolbar setframe:cgrectmake(0, 372, 320, 44)]; }
for top bar should anchored top. bottom bars anchored bottom of controller's view. map view should anchored top , bottom should have vertical spring.
now should expand correctly when have iphone 4 or 5.
also if targeting ios 6, take time use autolayout. way when iphonen has different resolution don't have worry layout much.
Comments
Post a Comment