I am trying to write an app that uses a custom keyboard. How can I write code that prevents the iPhone keyboard from popping up. I have seen a custom keyboard that enters text in other iPhone applications, so I know that it is possible.
You're looking for the inputView property that's present on every view (inherited from UIResponder).
Related
Can anyone please let me know how to hide the keypad without using 'blur' in titanium for IOS.
My scenario is I have a textfield, When I scan an item, that value will be shown on textfield. When textfield is focused, the scanner will be activated. In this scenario i need to focus the textfield, but should not show the keypad.
Can any one please share your ideas.
Thanks,
Swathi.
There is no possibility to hide keypad when textfield is focused on iOS. It is a system thing.
I think your approach is wrong. Why do you need textfield if you don't want to type text there?
Instead of it:
- create label (or label inside view) with proper background (looking like textfield),
- add 'click' event which will start scanning (i suppose you have that functionality for 'focus' event),
- if you need cursor blinking than create animation next to label.
I am using a UIWebView for text and emoticon/smiley display in my app. I can input and delete the text and emoticons using the keyboard, but I want to have a button in the UI which will do the same thing. How can I imitate the keyboard delete functionality with my own button?
My guess would be that you have to set up some sort of communication between the native app and the webview so that you can pass certain events to be handled accordingly. Check out the post here NSString in UIWebview that might shed some light on how you can solve your problem.
I have a simple (one view) application without any TextFileds. How can I show a native virtual keyboard when application starts?
You can use an invisible text field and give it focus. May I ask why you want a visible keyboard if there isn't a control for which the user will expect to receive the text?
I'm writing an app based around a calculator-like UI. On an iPad, I'd like the number UIButtons on my calculator UI to respond to the numbers on the external keyboard. I have no text input anywhere in the app, and I'd never want an on-screen keyboard to appear. How do I get my UIButtons to respond to specific key presses as if they'd been touched?
I'd say create a hidden UITextField with the delegate set, make it become the first responder upon viewDidLoad. The keyboard won't appear when a bluetooth keyboard is connected as far as I know, then just check what characters are typed in the shouldChangecharactersInRange and activate the right buttons accordingly.
EDIT: a quick example I just made, https://github.com/benjaminq42/buttonTest , if you wish to have a highlight animation of some sorts you need to create a custom UIButton class. You can use 'setHighlighted' but that 'sticks'.
In an application that I'm writing I have a UIWebview up top and some UITextFields at the bottom that I want the user to be able to type in depending on what's in the webview. But when they touch the Text Field and the keyboard pops up, the user loses the ability to manipulate the web page to see different parts.
Is there a way to keep the keyboard up and still be able to manipulate the UIWebView?
No I believe the Keyboard is modal so you can't access the form underneath it.
You can respond to the
- (void)keyboardWillShow:(NSNotification*)aNotification;
- (void)keyboardWillHidde:(NSNotification*)aNotification;
notifications and scroll the View up or down when the keyboard is shown...
Example here