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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:46:33+00:00 2026-05-25T01:46:33+00:00

My application is looking like the below snap in some scenario. There is one

  • 0

My application is looking like the below snap in some scenario.

enter image description here

There is one UITextField to get the department name from the user. Initially the “Done” button in navigation bar is set to disabled. That is, set right bar button’s enabled property to NO

The UIKeyBoard of the text field was made by the below code

fieldForDepartment.keyboardAppearance = UIKeyboardAppearanceAlert; //This provides the black appearance to the keyboard
fieldForDepartment.returnKeyType = UIReturnKeyDone; //This set the return key type as Done
fieldForDepartment.clearButtonMode = UITextFieldViewModeWhileEditing; //This is used because i want a small cross button in the right end of my text field to clear the text field value

(Here fieldForDepartment is the UITextField instance’s name)

I want to enable the “Done” button in the navigation bar if & only if, there should be atleast one letter in the text field (even may be a space). The “Done” button should get disable if there is a no letter in my text field.

For that, I implemented this code…

-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
    if ([[fieldForDepartment.text stringByReplacingCharactersInRange:range withString:string] isEqual:@""] || [fieldForDepartment.text stringByReplacingCharactersInRange:range withString:string] == nil) {
        rightBarButton.enabled = NO;
    }
    else {
        rightBarButton.enabled = YES;
    }
    return YES;
}

This method textField: shouldChangeCharactersInRange: get called for each letter press in the keyboard.

[fieldForDepartment.text stringByReplacingCharactersInRange:range withString:string] will bring the current string(included the last letter pressed) from the UITextField

So when pressing a letter in the text field the application will be like this…

enter image description here

Here my problem comes..

The “Done” button in the UIKeyboard is always highlighted. So this violates the behavior of the “Done” button in the navigation bar. I want to disable/enable the UIKeyboard’s Done button in the same way the navigation bar’s Done button works. Is it possible?

Some of the questions in my mind are..

Can i disable the “Done” button of UIKeyboard?

or

Can i just change the background color & selection color of the Done button in UIKeyboard? (So that the user may feel that the button can not be pressed)

or

Can i hide the Done button in UIKeyboard?

Please suggest which one is the good way to solve my problem…

Thanks in Advance

  • 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-25T01:46:34+00:00Added an answer on May 25, 2026 at 1:46 am

    There is an Auto-enable Return Key setting in the Text trait’s section of the Interface builder properties. It does exactly what you need, just make sure to check it.

    If you need to do the change in the code, use enablesReturnKeyAutomatically property of the UITextField (this is actually defined in the UITextInputTraits protocol that the class implements)

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

Sidebar

Related Questions

I'm looking into building a distributed application and would like some advice on the
I have some javacsript code looking something like below. Notice how it makes a
My application is looking like the below image I have 3 buttons in my
Before I get pointed to one of those 'VS.' questions like below... ASP.NET webforms
How would you design a hosted web application? I'm looking at applications like Basecamp,
i am looking for svn admin a desktop application like VisualSVN Server only for
I'm looking to write a notification application where I'd like to provide popup notifications
I'm looking to build a tree-like structure for my Java application. I've tried using
I'm looking for schemes for application version or milestone naming . I'd like to
Looking for a toolkit/SDK for general Blackberry development or application toolkits. Anything like an

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.