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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:04:29+00:00 2026-05-27T15:04:29+00:00

I am using a UISearchBar to match text input against entries in a database

  • 0

I am using a UISearchBar to match text input against entries in a database and display the matched results to the user in a UITableView, as they type.

All is well, however, I cannot find a way to alter the return key type of the search bar’s keyboard. By default it replaces the standard return key with a Search button. Because I am doing a live search as the user types, I do not need this button and having it there and inactive has raised some usability issues.

Attempted solutions

  1. I can set a keyboard with the setKeyboard:UIKeyboardType method, however this doesn’t seem to override the default setting of replacing the return key (on the standard keyboard) with a Search key and it does not allow access to change this return key.

  2. I have thought about using a UITextField, giving me access to the returnKeyType property through the UITextInputTraits protocol. My problem with this however is that I am implementing the UISearchBarDelegate method searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText, which I would lose with the UITextField.

Is there a way that I can keep the functionality of the search bar’s delegate methods, whilst having legitimate access to the keyboard’s return key?

In fact, almost the exact screen I am implementing is found in Apple’s Clock application
Screenshot:
enter image description here

So any help on a clean solution would be much appreciated. Note the return key on the bottom right instead of the default Search button’.

  • 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-27T15:04:29+00:00Added an answer on May 27, 2026 at 3:04 pm

    Try this:

    for(UIView *subView in searchBar.subviews) {
        if([subView conformsToProtocol:@protocol(UITextInputTraits)]) {
            [(UITextField *)subView setKeyboardAppearance: UIKeyboardAppearanceAlert];
        }
    }
    

    If you want to dismiss the return key (i.e., make it do nothing), set the “returnKeyType” property on the UITextField subview to “UIReturnKeyDone” along with “keyboardAppearence”.

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

Sidebar

Related Questions

I am using a UISearchBar and once the user taps the bar (and the
I'm using UISearchBar , and one of its properties, text , is declared as
On my iPhone app I'm using a UISearchBar (without a Search Display Controller). I
i am using UISearchBar in my app and it make search on UITableView. i
When using UISearchDisplayController with a UISearchBar in iPad, the default behavior is to display
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using C#, I need a class called User that has a username, password, active
I have a search functionality using UISearchBar that occurs on-the-fly, so I think it
I am using a UISearchBar and i want to change the Search key's label
Using iOS and a UISearchBar you can have a nice little cancel button setup

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.