2013-04-04 174 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

相關問題