Anyone has any idea how one can achieve the same look as when you press on the "From:" in the Mail iphone app when you have more than one user account.
I'd like to remove my keyboard, but WITHOUT animating it. Rather just disappear and instead of it have a UIPickerView appear.
Thanks much!
Since iOS 3.2 you can set the inputView property of a UITextField to a custom view. This view is then shown instead of the keyboard as input for that view.
There's no way to achieve this before iOS 3.2 I know.
UITextField Class Reference
Related
Is it possible to create a custom keyboard for iPhone or iPad in iOS 5 or later?
My thinking is I have to create my own keyboard with some icons. And It will popup custom keyboard while beginning the text in textfield.
Is It possible?
Thanks In advance.
You can make a custom input view, but within your application only (i.e. you cannot replace the keyboard across the entire device): https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/InputViews/InputViews.html#//apple_ref/doc/uid/TP40009542-CH12-SW2
Essentially you just assign your custom view to the inputView property of a UITextView (https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITextField_Class/Reference/UITextField.html#//apple_ref/occ/instp/UITextField/inputView) and your custom view will be shown when your input becomes the first responder.
I have my own custom keyboard in a uiview which i'm adding to the UIWindow in certain situations.
I switch between standard UIKeyboard and my custom keyboard with a button.
Problem: when i have my custom keyboard already shown on screen and i tap the UISearchBar i get the standard UIkeyboard shown above mine.
What I expect is to supress showing of Sandard UIKeyboard when i have my custom one already showing on screen.
I intercept keyboardwillshow event but it seems at this event is too late to do that.
I also tried subclassing UISearchBar and get control over its UITextField to get the Shouldbegintextediting but it doesn't seem to work ... (FYI UISearchBar doesn't have shouldbegintextediting event in the protocol. Its only for uitextfiled).
Also, there is no such thing as 'inputView' property in UISearchBar.
I tested this on iOS 5.1.
Anyone with experience on this kind of issue?
Thank you.
Set the inputView of the search field to your custom keyboard.
How do you make a keyboard have a textfield inside like the messages app ?
never tried but you can try this -
You can programmatically
set a tool bar.
set a textfield.
set the tool bar as the inputAccessoryView of the textfield.
make the textfield the first responder.
It depends what you're trying to do with it. You could simply create a view that looks like the keyboard section and show it right above the keyboard. If you're trying to actually send SMSs/emails, look up the MessageUI documentation.
Is it known how to get the keypad interface from the Phone and Skype apps? This is distinct from the modal keypad view that appears when a UITextField becomes the first responder.
Is this just a UIView that the developers of Skype laid out themselves in IB, complete with custom graphics to get the square shape of each button? Or is there some standard Cocoa Touch way to do it?
This isn't something that Cocoa Touch provides out of the box, no. I would imagine that the iPhone keypad is a set of UIButton objects arranged like a keypad and using custom graphics to get the visual appearance. This should be fairly easy to do in Interface Builder.
You may be looking for UIKeyboardType in the protocol UITextInputTraits, which is implemented by UITextField etc.. See the documentation at that link.
I was getting confused by your question too. I'm not aware of any but seeing as you would need somewhere to type in anyway wouldn't it be better to make the UITextField active on viewWillAppear and turn off touches on the rest of the view hence showing the keypad like the phone app?
I have a nice clean UI within a table view which has a few text fields for the user to fill out. One of the fields is for the user's birthday.
I'd like to have it so that when the user selects the birthday field, a view containing a UIDatePicker would come up as, just like the different keyboards do when selecting a text field.
Can this be done? I would have to prevent the text field from being the first responder (to avoid having the keyboard come up) and I would have to animate the view sliding up if no keyboard was showing before.
Would presenting the view modally be an option? If so how would I go about doing it? From the documentation it seems that modal views still take up the whole screen, I just want to use the lower 216 pixels (height of the keyboard and UIDatePicker).
Any one have any tips on how to go about doing this?
Old question but the correct way to do this these days would be to set the UITextField's inputView to a picker you created somewhere. Something like this:
UIPickerView *myPicker = [[UIPickerView alloc] init];
// set picker frame, options, etc...
// N.B. origin for the picker's frame should be 0,0
[myTextField setInputView:myPicker];
When you go to edit a UITextField, iOS really just displays whatever view is at textField.inputView which by default is the keyboard, you can make it anything you want as long as it's a subclass of UIView.
Regarding animation, take a look at DateCell sample application -
http://developer.apple.com/library/ios/#samplecode/DateCell/Introduction/Intro.html
And in any case, the proper way to do this is set UITextField's inputView to show the picker instead of the keyboard. That's what it's meant to do. More on that here:
How can I present a picker view just like the keyboard does?
Cheers,
Oded.
I would implement this by just animating a view containing the UIDatePicker, a Done, and Cancel button) up from the bottom of the screen. Using CoreAnimation, this should be pretty easy.
Why are you using a text field if you don't want to accept user input from a keyboard? Instead use a UILabel subclass (where you override the touchesBegan/Ended:withEvent: set of methods to show the UIDatePicker) or a UIButton (where your action is a method which slides up the UIDatePicker).