2013-04-04 181 views
0

我有一个tableview,长按一行触发动作表 - 选项。当我按下该行的任何地方时,操作手册在横向/纵向模式下正常显示(请考虑iPad屏幕)。但是当我长时间在风景模式下(接近泄露指示符)按下该行的最右侧时,并且切换到肖像模式时,操作表的显示如下所示。UIActionsheet位置从横向模式改变为肖像模式

enter image description here

回答

1

UIActionSheet当屏幕旋转时它保持它在哪里,而一切移动本身并不锚定到什么,所以。您想重新显示willAnimateRotationToInterfaceOrientation:didAnimateRotationFromInterfaceOrientation中的操作表。

+0

试过这个,但没有工作: - (void)doAnimateRotationFromInterfaceOrientation:(UILongPressGestureRecognizer *)gestureRecognizer if([gestureRecognizer state] == UIGestureRecognizerStateBegan){CGI点= [gestureRecognizer locationInView:self.tableView]; self.contactIndexPath = [self.tableView indexPathForRowAtPoint:point]; if(self.contactIndexPath!= nil){self showPopoverForContactAtPoint:point]; }} } 不知何故 – 2013-04-08 18:12:20

+0

着这里格式的注释:请访问的链接代码:https://gist.github.com/akiitrivedi/5339115感谢 – 2013-04-08 18:16:24

+0

这些都是不正确的方法定义。他们没有手势识别器作为参数。检查[UIViewController文档](http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html) – MishieMoo 2013-04-08 18:19:17

相关问题