Re: KeyboardType for an iOS searchBar.
Re: KeyboardType for an iOS searchBar.
- Subject: Re: KeyboardType for an iOS searchBar.
- From: Alex Zavatone <email@hidden>
- Date: Wed, 20 Mar 2013 15:19:26 -0400
On Mar 20, 2013, at 1:27 PM, Matt Neuburg wrote:
> On Wed, 13 Mar 2013 17:54:40 -0400, Alex Zavatone <email@hidden> said:
>> Yeah, that's the point. I know you can set it a la the storyboard, but once it is set (once it's on the scene, the default is what is set) it's really hard to change.
>>
>> I have cases where the data the searchBar will be searching will all start with numbers and other cases where it will all start with letters.
>>
>> Based on the data, I would like to display the default keyboard, or the UIKeyboardTypeNumbersAndPunctuation keyboard.
>>
>> In any case, it appears to be very difficult to change the keyboard of the searchBar when it is created by placing it in a scene in a storyboard.
>>
>> If you know how to do it, I'd sure like to know how
>
> So you're saying you're setting the UISearchBar's keyboardType property but it doesn't "take"? I wonder if it would help to locate the UISearchBar's internal UITextField and set its keyboardType directly. I've found various circumstances where this is necessary... Just an idea -
Correct. It only appears to work (change to display the expected keyboard) if I set it from within searchBar:textDidChange
This means that the user has to already have entered text in the search field before the keyboard will change and then it will change just fine. But that means that the keyboard is displayed for a little while and what is displayed is the keyboard that was set in the storyboard, not what I had reset it to in any previous routine.
I'll try out your suggestion. Fingers crossed. Thanks.
> m.
>
> --
> matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
> A fool + a tool + an autorelease pool = cool!
> Programming iOS 6! http://shop.oreilly.com/product/0636920029717.do
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden