tags:

views:

226

answers:

1

Hi guys,

Here Im got a problem that is to my view I used the autoroation its working fine in both Landscape and potrait but my problem here is I had a button in my navigation bar when I click on to the button an action sheet will generate.when I rotate the view into lanscape the action sheet is not rotating in lanscape mode.

can any one gimme a solution to get out of this???

Anyone's Help will be much appreciated.

Thank you, Monish.

A: 

UIActionSheet autorotates automatically - its orientation is the same as the view's on which it is being shown. So that if you have a controller which can be rotated to any orientation(implements the following:


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
   return YES;
}
) Then if you show your UIActionSheet in this controller's view, action sheet will be of the same orientation as the controller's view and will autorotate automatically.

But if you will somehow show this UIActionSheet in the window(main application window), which does not autorotate to landscape, than your controller will rotate to landscape and after clicking the button, your UIActionSheet won't be presented in landscape but in portrait as the main window.

krasnyk
Thanks very much.Its working fine when Im adding the action sheet to the controller but I got nother problem actually Im having a tabbar in my view and the actionsheet displays on the tababar.Iam having cancel button in the action sheet when I tap the cancel button in upper part its working and when I click into lower its not coz behind the lower part tabbar is there so its not working.can u gimme any idea for this?
monish
I suppose that you show the UIActionSheet in the controller's view then. Try showing it from tabBar:[sheet showFromTabBar:self.tabBarController.tabBar];This should help :)
krasnyk
Thanks very much its working fine....
monish
I'm using the 3.1.2 SDK and my UIActionSheet is not being rotated, even though the view it is shown over is autorotated. I'm using the showInView: method and passing the viewcontroller's view as a parameter. If I open the actionsheet in portrait or landscape it works, but it will not rotate WHILE it is shown.
nobre
True. ActionSheet won't be rotated then. This is how the SDK works(see in the Mail application - view the mail, press the reply button and rotate the device to the landscape). I guess the view on which the UIActionSheet is being shown is not rotating to the landscape when the UIActionSheet is shown as well, cause is this manner the view is not at the top so that doesn't rotate - and the rotation of the UIActionSheet depends on the view in which it is shown.
krasnyk