Search code examples
iphoneuiactionsheet

How can I make UIActionSheet translucent when shown from a tab bar?


I am using a very simple UIActionSheet. Here is the code below:

 UIActionSheet *editActionSheet = [[UIActionSheet alloc] initWithTitle:@"What do you like to do?" 
                                                             delegate:self 
                                                    cancelButtonTitle:@"Cancel" 
                                               destructiveButtonTitle:@"Delete All Tasks" 
                                                    otherButtonTitles:@"Arrange Task List", @"Mark All as Done", nil];

editActionSheet.actionSheetStyle = UIBarStyleBlackTranslucent;
[editActionSheet showFromTabBar:appDel.tabBarController.tabBar];
[editActionSheet release];

Although I set the action sheet style to translucent, it always appear opaque. I don't know why?

Thank you,


Solution

  • What I did in an app I'm creating was use [editActionSheet showInView:appDel.tabBarController.superview]; instead of [editActionSheet showFromTabBar:appDel.tabBarController.tabBar];. Accomplishes the same thing for all intents and purposes, and is much easier to implement than your answer. Just another way.