Obj-C, why is my UIActionSheet cancel button hard to click?

I noticed in my application that my cancel button is hard to press, it looks like the hit area is not in the center.

How to fix it?

Here is my code ...

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:dg cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles: @"Help Pages", @"Tutorial", @"Feedback / Questions ", @"Facebook Group", @"About", nil]; actionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque; [actionSheet setTag:CommonUIActionSheetHelp]; [actionSheet showInView:vw]; [actionSheet release]; 
+4
source share
3 answers

agrees with the answer of Ravin and you can try

 [actionSheet showInView:[UIApplication sharedApplication].keyWindow]; 

he can also help

+5
source

I think your problem lies in [actionSheet showInView:vw]; maybe you are using tabBarController / toolBar in your application (below), this error occurs at this time.

You should use either showFromToolbar or showFromTabBar to suit your design. If your design is different, please indicate it. (If there is no tabBar / toolBar).

thanks

+6
source

I have a similar problem in iOS 8 using UIAlertController with UIAlertControllerStyleActionSheet style.

The problem is that the first click on the action sheet is ignored.

It turned out that this is due to the fact that my text field keyboard interferes with touches.

The fix is ​​to release the keyboard first and then present the action sheet.

 [textfield resignFirstResponder]; [self presentViewController:alert animated:YES completion:nil]; 
0
source

All Articles