iPhone - 有键盘滑入从右侧视图中的联系人编辑笔记时一样 [英] iPhone - Have the keyboard slide into view from the right like when editing a note in Contacts
问题描述
我正在寻找一种方式来将键盘从右侧滑入视图,就像当你编辑注释中的联系人应用程序会发生什么。
I'm looking for a way to slide the keyboard into view from the right, like what happens in the Contacts application when you edit a note.
我的问题是,当我打电话[someTextView becomeFirstResponder]在viewWillAppear中,键盘立刻有没有动画弹出。当我把它称为viewDidAppear,视图首先从右侧滑入(UINavigationController的不滑动),然后将键盘从底部滑出。
My problem is that when I call [someTextView becomeFirstResponder] in viewWillAppear, the keyboard immediatly pops up with no animation. And when I call it in viewDidAppear, the view first slides in from the right (UINavigationController does the sliding), and then the keyboard slides in from the bottom.
这样的观点是否有可能在从右侧的键盘滑,一起?
Is it possible to have the keyboard slide in from the right, together with the view?
推荐答案
所有你需要做的就是告诉有问题的文本视图,成为第一个响应的 viewDidLoad中
你推到导航堆栈的视图控制器的方法:
All you need to do is tell the text view in question to become the first responder in the viewDidLoad
method of the view controller you're pushing onto the navigation stack:
override func viewDidLoad() {
super.viewDidLoad()
someTextView.becomeFirstResponder()
}
这工作在iOS的8键盘从右边的观点沿滑动。
This works in iOS 8. The keyboard slides in from the right along with the view.
这篇关于iPhone - 有键盘滑入从右侧视图中的联系人编辑笔记时一样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!