Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 305295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:21:37+00:00 2026-05-12T07:21:37+00:00

I have a UIBarButtonItem opening an action sheet to offer users choices about what

  • 0

I have a UIBarButtonItem opening an action sheet to offer users choices about what to do. Everything works as expected unless I try to click on the “Cancel” button. The target of the button appears to have moved up from where it should be. I can only activate it by clicking somewhere in the middle of the “Cancel” and “Ok” buttons.

I’ve tried at action sheets in other applications and they work fine, so it’s not just my big thumb. The action sheet is opening in a UIViewController

- (void)showOpenOptions
{
    UIActionSheet *sheet = [[UIActionSheet alloc] 
    initWithTitle:NSLocalizedString(@"Open link in external application?", @"Open in external application")
    delegate:self
    cancelButtonTitle:NSLocalizedString(@"Cancel", @"Cancel")
    destructiveButtonTitle:NSLocalizedString(@"Open Link", @"Open Link")
    otherButtonTitles:nil];

    [sheet showInView:self.view];
    [sheet release];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:21:37+00:00Added an answer on May 12, 2026 at 7:21 am

    Instead of passing the current view controller’s view to the action sheet, use the showFromTabBar: method of UIActionSheet.

    The Right Way
    This will give the correct tappable area:

    [actionSheet showFromTabBar:self.tabBarController.tabBar];
    

    The Wrong Way
    This will put the tappable area in the wrong place (if you’re using a tab bar or toolbar):

    [actionSheet showInView:self.view];
    

    If you’re using a toolbar, use the showFromToolbar: method instead. You’ll need a reference to the toolbar, most likely an ivar

    [actionSheet showFromToolbar:self.myToolbar];
    

    My Old Answer Also works, but is hacky:

    Just found a possible answer:

    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.

    http://openradar.appspot.com/6410780

    Edit: It works correctly when I change the view to be the tab bar’s view

    [sheet showInView:self.parentViewController.tabBarController.view];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have standart UIBarButtonItem UIBarButtonItem *share = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share:)]; How to
I am trying to set the action for a UIBarButtonItem I have in my
I have a toolbar with 4 UIBarButtonItem's, on click of one of the buttons,
I have a refresh button on my navigationbar buttonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(buttonItemClicked)];
I have three UIBarButtonItem created as below. They align left and I'd like to
I have a UIBarButtonItem on a navigation bar. I'd like to make it arrow
I am new to iphone development.I have created a UIBarButtonItem on the navigation bar.I
I have added a refresh UIBarButtonItem to my navigation bar on my iPhone app.
I'm building an iPhone game and I have a UIBarButtonItem that will provide the
I have an Edit/Done UIBarButtonItem, and I also have a Cancel button in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.