Return to Snippet

Revision: 26647
at May 5, 2010 10:51 by espinallab


Initial Code
//This will fix the problem when clicking on the cancel button of an actionsheet inside a Tab Bar Controller
[actionSheet showInView:self.parentViewController.tabBarController.view];

Initial URL
http://stackoverflow.com/questions/1197746/uiactionsheet-cancel-button-strange-behaviour

Initial Description
01-Dec-2008 10:22 PM Tom Saxton: I looked at this bug some more, and it seems to be an issue with the tabbar.

    If you call UIActionSheet's [sheet showInView:self.view] from a view controller that is a child of a UITabViewController, then the hit testing on the cancel button fails in that portion of the UIActionSheet that lies above the tabbar's view.

    If you instead pass in the UITabBarController's view, then the UIActionSheet acts as expected.

    NOTE: in iPhone OS 2.1 and earlier, the UIActionSheet came up from the top of the tab bar when you pass the child view, but in 2.2, it comes up from the bottom of the tab bar, and thus covers the tab view.

Initial Title
UIActionSheet cancel button strange behaviour

Initial Tags


Initial Language
Objective C