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

  • SEARCH
  • Home
  • 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 7741441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:01:54+00:00 2026-06-01T09:01:54+00:00

I have a nav controller with a toolbar. I made the toolbar also appear

  • 0

I have a nav controller with a toolbar. I made the toolbar also appear on top of the keyboard when the keyboard appears. When I dismiss the keyboard, the toolbar disappears, leaving a black rectangle at the bottom of the screen, just where the toolbar should be without the keyboard.

Here’s how I init the toolbar:

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.navigationController setToolbarHidden:NO];

    // this makes sure the toolbar appears on top of the keyboard
    // instead of going below it.
    // _nameText is a UITextField
    _nameText.inputAccessoryView = self.navigationController.toolbar;
}

This is how I hide the keyboard:

- (BOOL)textFieldShouldReturn:(UITextField *)textField {
    [textField resignFirstResponder];
    [self.navigationController setToolbarHidden:NO]; // this doesn't help
    return NO;
}

I tried also doing [self.view setNeedsLayout], but that didn’t work.

EDIT: I suspect this may have to do with the fact that I assign the toolbar to be the input accessory view of my text field. I think that the text field hides its accessory view when the keyboard goes away. I still don’t know how to override that behavior though.

EDIT 2: I discovered that self.navigationController.toolbar.superview is nil after the keyboard is gone.

  • 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-06-01T09:01:56+00:00Added an answer on June 1, 2026 at 9:01 am

    OK, so while I couldn’t solve the problem head-on, I found an acceptable workaround.

    1. Create a .xib for your toolbar

    2. Load the toolbar from (1) into an object

    3. assign that object to the inputAccessoryView property of your text field

    4. set up the target and the actions for the buttons in this toolbar, so you can respond to clicks

    You are now all set. Your original toolbar (which you presumably have created in the Interface Builder) is only visible when the keyboard is hidden. When the keyboard is visible, the original toolbar cannot be seen, but your other one (created with the steps described above) now appears above the keyboard. Bingo!

    If anyone has a more elegant solution to this problem, I’d be happy to hear about it 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a nav controller and I push a view on the screen,
I have a simple nav made up of the following HTML; <div class=inner> <div
I have built a nav where I have an unordered list made up of
using xcode 4.2 and iOS 5 and have nav bar on root controller and
I have 2 tab bars in a tabbar controller, each with a nav controller.
I have a Nav controller that starts at a table view. Each row pushes
I have a table view nav controller that once a cell is selected it
In my app with nav controller, I have a weird white line appearing at
I have an iPhone app with a detail view in a nav controller. When
I have pushed a view onto my nav controller that contains a UIWebView and

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.