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 6126219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:20:42+00:00 2026-05-23T16:20:42+00:00

I have a UIToolbar set to the inputAccessoryView of a UITextView . This shows

  • 0

I have a UIToolbar set to the inputAccessoryView of a UITextView. This shows the toolbar on top of the keyboard, when editing. I have, however, encountered a problem when rotating the device: the toolbar should become a little less heigh (32 pixels vs 44). When I just update the height of the toolbar, I get a little white space between the toolbar and the keyboard:

image

So I used -didRotateFromInterfaceOrientation: to also update the origin, and then it works when rotating from portrait to landscape. When rotating back up, however, the toolbar is 12 pixel too low and overlapping the keyboard:

image

By then, the origin is (0,0) again and setting a negative value didn’t help. Any suggestions of how to make it work so that the toolbar changes its size and never overlaps?

  • 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-23T16:20:42+00:00Added an answer on May 23, 2026 at 4:20 pm

    I fixed it by calling [textView resignFirstResponder] in -willRotateToInterfaceOrientation:duration: and [textView becomeFirstResponder] in -didRotateFromInterfaceOrientation:. The system seems to adjust the frame properly.

    - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
    {
        didShowKeyboard = [self.textView isFirstResponder];
    
        [self.textView resignFirstResponder];
    }
    
    - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
    {
        CGRect toolbarFrame = [self.navigationController.toolbar bounds];
        self.keyboardToolbar.frame = toolbarFrame;
    
        if (didShowKeyboard)
            [self.textView becomeFirstResponder];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set my UIToolBar tint color to some value, and there is this
I have a UIToolbar where I have dragged a UIButton. When I set the
I have a UISegmentedControl on a black UIToolbar. I have set the style to
I have a UIToolbar that I set up using IB with three buttons, left,
I have a UIToolbar in which I have placed a UIProgressView successfully. However, I
I have a UIToolbar. If I create a UIBarButton like this, it works: UIBarButtonItem
I have a UIToolbar with the alpha set to .6. Looks great - but
I have an button on UIToolbar. i need to display another toolbar on clicking
I have a UIScrollView that contains a UIToolbar, but when I scroll, the toolbar
Is it possible to have a UIToolbar on the top of the screen? 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.