Posted By

espinallab on 05/05/10


Tagged

UIActionSheet


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

umang_nine


UIActionSheet cancel button strange behaviour


 / Published in: Objective C
 

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

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.