UIActionSheet cancel button strange behaviour


/ Published in: Objective C
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  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];

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.