java 转换模态_旋转时呈现模态视图

所以我有一个UITableViewControler以纵向模式显示tableview .

一旦我旋转iPhone,我想在横向模式下呈现模态视图 .

在tableView我使用:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);

}

并处理目前的模态视图:

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation duration:(NSTimeInterval)duration {

if((interfaceOrientation == UIInterfaceOrientationLandscapeRight) || (interfaceOrientation == UIInterfaceOrientationLandscapeLeft))

{

NSLog(@"Push page view");

PagingViewController *s = [[PagingViewController alloc] initWithNibName:@"PagingView" bundle:nil];

s.hidesBottomBarWhenPushed = YES;

[self presentModalViewController:s animated:YES];

[s release];

}

}

模态视图我有以下内容:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);

}

并且为了解雇它自己的模态视图,我这样做:

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation duration:(NSTimeInterval)duration {

if (interfaceOrientation == UIInterfaceOrientationPortrait)

{

NSLog(@"Dismiss my self");

[self.parentViewController dismissModalViewControllerAnimated:YES];

}

}

一些如何工作两次 . 第三次将iPhone从纵向模式旋转到横向模式时,我收到了错误的访问错误 .

我无法弄清楚是什么给了我错误 . 有人关心一枪吗?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值