开发者

Dismiss UIActionSheet before device rotate?

In portaint Actionsheet show in tabbar. In landscape - in 开发者_高级运维window. I heed do remove UIActionSheet from tabbar before rotate, for after rotate show in wondow. Inside – willRotateToInterfaceOrientation:duration dismiss action sheet dont work.


You can use NSNotification for this. Add this notifier in your viewdidload file you willl get notify when orientation is going to change:

[[NSNotificationCenter defaultCenter] addObserver:self 
    selector:@selector(OrientationChanged:) 
    name:@"UIDeviceOrientationDidChangeNotification"
    object:nil];

…add this method:

-(void)OrientationChanged
{

}

See NSNotification class reference.


Me i dismiss before rotation and show after, then the UIActionSheet is replaced at middle;

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    [APP.validSave dismissWithClickedButtonIndex:1 animated:NO];
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    [APP.validSave showInView:APP.navController.view];
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜