Posted By

espinallab on 05/05/10



Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


UIActionSheet cancel button strange behaviour

 / Published in: Objective C


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.
  1. //This will fix the problem when clicking on the cancel button of an actionsheet inside a Tab Bar Controller
  2. [actionSheet showInView:self.parentViewController.tabBarController.view];

Report this snippet  

You need to login to post a comment.