objective c - Change Orientation in iOS 5.0 -
i creating 1 project in viewcontroller. have image view, labels , scrollview
. when change orientation aligning in bad way?
is there way align correctly? scrollview not working. set delegate view in storyboard.my controll frame are(landscape mode).
book_cover_image.frame=cgrectmake(50,20,250,300); label_book_name.frame=cgrectmake(350,20,500,50); label_book_author.frame=cgrectmake(350,76 , 500, 50); label_book_price.frame=cgrectmake(350,135, 500, 50); image_price_rupees.frame=cgrectmake(100, 330, 22, 16); [buy_button setframe:cgrectmake(13, 380, 119, 32)]; [preview_button setframe:cgrectmake(150, 380, 113, 32)]; recommendedbooksview.frame=cgrectmake(0,400,1024,368); _thumbnaillistview.frame=cgrectmake(15, 50, 950,350);
you might consider using autoresizingmask property of uiview automatically resize , reposition views during rotation.
http://www.techpaa.com/2012/05/understanding-uiview-autoresizing.html
if autoresizingmask cannot want, can customize frame each orientation implementing:
- (void)willanimaterotationtointerfaceorientation:(uiinterfaceorientation)interfaceorientation duration:(nstimeinterval)duration { [uiview animatewithduration:duration animations:^{ //set new frame properties }]; }
in view controller.
Comments
Post a Comment