[转]How to hide inputAccessoryView without dismissing keyboard
2013-01-18 11:39
501 查看
I am using a toolbar in the inputAccessoryView property of a textView. When the keyboard shows, it displays the toolbar as expected. When the device is rotated I want to remove the toolbar. I tried:
Screenshot- the faint line above the keyboard is remnant of the removed toolbar
=================================================================================
Never found a way to alter the frame of the keyboard. Ultimately decided to forego the inputAccessoryView, add my toolbar directly to the view as a subview and animate it myself along with the keyboard directly. This keeps the two independent and so, no more line.
myTextView.inputAccessoryView.hidden = !layoutIsPortrait;This does hide the toolbar, but leaves the outline of the taller keyboard behind. The keyboard is apparently still sized to fit the toolbar. It looks bad and interferes with touch events of underlying responders.
myTextView.inputAccessoryView = nil;Works only if I resignFirstResponder, then becomeFirstResponder again. This is not acceptable. I lose the cursor placement and content of the textView, keyboard flashes out and back.
[myTextView.inputAccessoryView removefromSuperview];Does nothing at all. I saved a reference to the toolbar in a iVar and addressed that instead,
[myIvarReference removeFromSuperview];That works, but again the taller outline of the keyboard is faintly visible. This time it does not interfere with touches of other views. So now this is a working solution but visually unacceptable. What else can I try to show and hide the inputAccessoryView at will?
Screenshot- the faint line above the keyboard is remnant of the removed toolbar
=================================================================================
Never found a way to alter the frame of the keyboard. Ultimately decided to forego the inputAccessoryView, add my toolbar directly to the view as a subview and animate it myself along with the keyboard directly. This keeps the two independent and so, no more line.
相关文章推荐
- How to hide keyboard when you click backgroud in a TTTableView?
- How to Hide Zip Files Inside a Picture Without any Extra Software in Windows
- keyboard监听、inputView、inputAccessoryView
- How to hide the create button dynamical tree view in openerp ?
- how to javafx hide background header of a tableview?
- How to hide keyboard in Swift
- iOS how to stop a scrolling scrollView
- [Android 問題] How to Activate Multi-Touch in WebView (for Web Browser, Google Map, etc)?
- How to Create a Notify Icon in C# without a form
- How to remove a ClearCase view
- HowTO: Create an Event Log Source in code, without the Permission errors
- How to create custom ViewEngine in MVC 2
- angularjs How to set focus on input field?
- How to Clear the Application Server Cache Without Shutting it Down
- how to view svn log recursively
- iOS UITextField InputAccessoryView & InputView的使用方法
- string - How to get the filename without the extension from a path in Python? - Stack Overflow
- inputAccessoryView 自定义键盘
- How To Create 32-bit Import Libraries Without .OBJs or Source
- 为键盘添加inputAccessoryView