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, 13 Mar 2013 17:54:40 -0400
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. Also, why is it so hard to override these UISearchBar properties defined by a storyboard setting? I've run into other cases where it's really difficult to enable/disable the cancel button + other settings of a UISearchBar.
Thanks Diederik.
On Mar 13, 2013, at 5:42 PM, Diederik Meijer | Ten Horses wrote:
> Maybe I'm missing the point, but you can set the keyboard type in the storyboard settings for it.. Or do you need to change it programmatically for some particular reason?
>
>
>
>
> Op Mar 13, 2013, om 6:51 PM heeft Alex Zavatone <email@hidden> het volgende geschreven:
>
>> Hopefully, this will be a more constructive question for the list.
>>
>> On iOS in Xcode 4.2, I've put a storyboard scene together with a tableView and a searchBar.
>>
>> The searchBar searches the tableView just fine, but my problem is how and when the storyboard defaults are applied to the searchBar and the resulting keyboard? I ask, because it appears that it's only possible to override the storyboard defaults to set the keyboardType within the searchBar:textDidChange: method and this seems really clunky.
>>
>> I'm using the methods below and I've tried setting the keyboardType on the viewController's viewDidLoad, viewDidAppear, after notification from UIKeyboardDidShowNotification, nothing works to override the setting used in the storyboard except for searchBar:textDidChange:, which is not acceptable.
>>
>> [searchBar setKeyboardType:UIKeyboardTypeNumbersAndPunctuation];
>> [searchBar reloadInputViews];
>>
>> I'm extending the interface to use the UISearchBarDelegate. Is there anything obvious here that I might be missing?
>>
>> TIA,
>> - Zav
>> _______________________________________________
>>
>> 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
>>
>
_______________________________________________
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