Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone - weird bug between UIActionSheet and UITabBar

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 http://img12.imageshack.us/img12/2166/screenshot20100119at236.png

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];
like image 346
oberbaum Avatar asked Dec 01 '22 06:12

oberbaum


1 Answers

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];
like image 72
Philippe Leybaert Avatar answered Dec 06 '22 00:12

Philippe Leybaert