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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:30:11+00:00 2026-06-06T18:30:11+00:00

I have an instance of UIToolbar that contains a UITextField inside. I’d like to

  • 0

I have an instance of UIToolbar that contains a UITextField inside. I’d like to set the toolbar at an accessory view for the UITextField it contains.

The way I do this is as follows:

[myTextView setInputAccessoryView:myToolbar];

When I compile and run the code, the entire keyboard disappears when I press on the text field. I specifically made sure I am setting the inputAccessoryView and not the inputView. It seems like the whole input view just got replaced, without any explicit direction to do so.

Does anyone know a way to fix this?

  • 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-06T18:30:12+00:00Added an answer on June 6, 2026 at 6:30 pm

    It’s generally not good to put a text field in an input accessory view… What would be better is if you put the toolbar along the bottom of your view and then use UIKeyboardWillChangeFrameNotification to move the toolbar with the keyboard…

    In your viewDidLoad:

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChange:) name:UIKeyboardWillChangeFrameNotification object:nil];
    

    And somewhere in your view controller’s code:

    -(void) keyboardWillChange:(NSNotification*)notify {
    
        CGRect endFrame;
        float duration = [[[notify userInfo] valueForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue];
        [[[notify userInfo] valueForKey:UIKeyboardFrameEndUserInfoKey] getValue:&endFrame];
        endFrame = [self.view convertRect:endFrame fromView:nil];
        float y = (endFrame.origin.y > self.view.bounds.size.height ? self.view.bounds.size.height-44 : endFrame.origin.y-44);
    
        [UIView animateWithDuration:duration animations:^{
            toolbar.frame = CGRectMake(0, y, self.view.bounds.size.width, 44);
        }];
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an instance variable in my view controller that I would like to
I have an instance method that I'd like to invoke directly using the callback
I have an instance of the Popen class created through subprocess.Popen. I would like
I have an instance of Class A that I want to refer to in
I have a instance of Oracle Access Manager set up on Server A and
I have put a button over a toolbar.But when i press that button,my selector
I have for instance the following string: 0x780000105d0e0030 If this is not the string,
I have some instance variables in my class that I'd want to be accessible
Looking at the docs for Control.Applicative , I notice that they have instance declarations
I have two models like this: class A(models.Model): attachment = FileField(upload_to='a') class B(models.Model): attachment

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.