Search code examples
ioscocoa-touchuiactionsheet

Obj-C, why is my UIActionSheet Cancel button hard to tap?


I've noticed in my app that my cancel button is hard to tap, it seem like the hit area is not in the center.

How do I fix this ?

Heres 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];

Solution

  • agree whit Ravin answer and you can try

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

    it can help also