Reputation: 19507
I have an UIActionSheet and I am specifying the cancel button however it does not dismiss when its tapped?
UIActionSheet *actionSheet = [[[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Target Complete" otherButtonTitles:nil] autorelease];
[actionSheet showInView:self.view];
According to the documentation I don't need any code and even when I try and implement the didCancel delegate method its never called?
Upvotes: 12
Views: 9603
Reputation: 1662
use
[actionSheet showFromTabBar:[[self tabBarController] tabBar]];
instead of
[actionSheet showInView:self.view];
this is working fine.. :-)
Upvotes: 4
Reputation: 1515
I found the answer here.
https://stackoverflow.com/a/1530259/1803218
[menu sendSubviewToBack:pickerView];
Upvotes: 0
Reputation: 3541
write simplite code
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
this work fine
Upvotes: 0
Reputation: 586
This Will do the trick
[actionSheet showInView:[self.view window]];
instead of
[actionSheet showInView:self.view];
Upvotes: 14
Reputation: 113747
Try this
[actionSheet showInView:[self.view window]];
UIActionSheet cancel button strange behaviour
Upvotes: 42
Reputation: 19507
You need to display from a taskbar or a toolbar on iPhone as it clips some of the controls if you use display in view.
Upvotes: 3