views:

378

answers:

2

hey In my tabbar app, i bring up a UIActionsheet from an action, called from a button in a navigation controller title bar.

The UIActionsheet functions as per normal, except for the bottom half of the below button 'cancel', which strangely doesnt respond to touch in the iPhone Simulator. The bottom half of the cancel button is where the UITabBar lies behind, and therefore is probably the problem.

Any ideas?

alt text

Solution

My solution was from the first answer. Here is my working example code

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:message delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"OK" otherButtonTitles:nil];
        actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
        [actionSheet showInView:[UIApplication sharedApplication].keyWindow];
        [actionSheet release];
+7  A: 

This looks like an UIActionSheet to me...

Anyway, you should show the action sheet as a subview of the application window, not of the current view.

UIActionSheet *actionSheet = [[UIActionSheet alloc] init...];

// ...

[actionSheet showInView:[UIApplication sharedApplication].keyWindow];
Philippe Leybaert
yep, awesome, worked perfectly.
norskben
A: 

Looks like this works regardless of if you are using a TOOLBAR or a non-TOOLBAR view.

Should we just 'always' use this method?

Patricia