iphone - Rotating Not Detected -
i using:
if (uiinterfaceorientationlandscapeleft | uiinterfaceorientationlandscaperight) { viewofimage.frame = cgrectmake(130, 45, 220, 115); share.frame = cgrectmake(205, 161, 70, 70); invite.frame = cgrectmake(8, 161, 70, 70); contact.frame = cgrectmake(402, 161, 70, 70); invitation.frame = cgrectmake(3, 227, 81, 21); sharing.frame = cgrectmake(200, 227, 81, 21); contacting.frame = cgrectmake(397, 227, 81, 21); } else { viewofimage.frame = cgrectmake(20, 64, 280, 206); invite.frame = cgrectmake(8, 285, 70, 70); share.frame = cgrectmake(125, 285, 70, 70); contact.frame = cgrectmake(242, 285, 70, 70); invitation.frame = cgrectmake(3, 358, 81, 21); sharing.frame = cgrectmake(120, 358, 81, 21); contacting.frame = cgrectmake(237, 358, 81, 21); }
to set buttons , labels in places when rotated. issue when leave view controller , go different controller, same code in place, not move buttons , labels defined cgrectmake values. moves them when selected viewcontroller rotated. how can other view controllers detect orientation in, , have resized when getting them?
set uiview's automasksubview false using method:
- (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation{ if (interfaceorientation = uiinterfaceorientationlandscapeleft || interfaceorientation = uiinterfaceorientationlandscaperight) { viewofimage.frame = cgrectmake(130, 45, 220, 115); share.frame = cgrectmake(205, 161, 70, 70); invite.frame = cgrectmake(8, 161, 70, 70); contact.frame = cgrectmake(402, 161, 70, 70); invitation.frame = cgrectmake(3, 227, 81, 21); sharing.frame = cgrectmake(200, 227, 81, 21); contacting.frame = cgrectmake(397, 227, 81, 21); } else { viewofimage.frame = cgrectmake(20, 64, 280, 206); invite.frame = cgrectmake(8, 285, 70, 70); share.frame = cgrectmake(125, 285, 70, 70); contact.frame = cgrectmake(242, 285, 70, 70); invitation.frame = cgrectmake(3, 358, 81, 21); sharing.frame = cgrectmake(120, 358, 81, 21); contacting.frame = cgrectmake(237, 358, 81, 21); } return yes; }
Comments
Post a Comment