Quote:
Originally Posted by StatCoder
It looks like this method will not work on iPhone OS4 devices. The keyboard is not modified. I guess that means we have probably have about four weeks to modify our apps or they will not work when iPhone OS4 is released to the public. Anyone have any ideas?
|
Super easy. in iPhone OS 4.0 as same as iPhone 3.2 there is a inputView and accessoryInputView property
@property (readwrite, retain) UIView *inputView
so you can use it like this: (from my head, not tested)
for example override viewDidLoad in your ViewController
Code:
UITextView * textView = [[UITextView alloc] initWithFrame:frame];
MyKeyboard *mykeyboard = [[MyKeyboard alloc] initWithSomething:something];
textView.inputView = myKeyboard;
[myKeyboard release];
[viewController.view addSubview:textView];
[textView release];
[textView becomeFirstResponder]
;
And then you will have your keyboard without all the searching for UIKeyboard view everytime the keyboard will appear. No notifications, nothing. Easy.
If you want to implement more difficult stuff you probably want to look at documentation and look for iPad Programming guide, UITextInput and other new protocols are explained so you can implement your textView and get capabilities like text correction, conversion (in case of japanese, etc.) from the OS.
Cheers.
--> If you want only a dot Button on numeral keyboard, have you tried adding you button to your application.window object?
In theory if you add a view there it should appear above the keyboard. You will have to handle animations to make it look native.
I hope it helps