1 UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self cancelButtonTitle:
@"
取消
" destructiveButtonTitle:
@"
拍照
" otherButtonTitles:
@"
选择照片
", nil];
2
3 // [sheet showInView:self.view]; 把这个换为以下即可(tabbar刚好在取消按钮的地方,不过UIActionSheet是在tabbar上方,估计冲突...)
4 [sheet showInView:[UIApplication sharedApplication].keyWindow];
2
3 // [sheet showInView:self.view]; 把这个换为以下即可(tabbar刚好在取消按钮的地方,不过UIActionSheet是在tabbar上方,估计冲突...)
4 [sheet showInView:[UIApplication sharedApplication].keyWindow];
特别提醒: 用[sheet showInView:[UIApplication sharedApplication].keyWindow];在横屏的时候会出现UIAtionSheet为竖屏,
解决办法:就是把它加到tabbar上.解决了横竖屏以及取消无法点击的情况
[myActionSheet showInView:self.tabBarController.tabBar]; OK了!!!!!