iPhone - 让键盘从右侧滑入视图,就像在“通讯录"中编辑笔记时一样

iPhone - Have the keyboard slide into view from the right like when editing a note in Contacts(iPhone - 让键盘从右侧滑入视图,就像在“通讯录中编辑笔记时一样)
本文介绍了iPhone - 让键盘从右侧滑入视图,就像在“通讯录"中编辑笔记时一样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在寻找一种将键盘从右侧滑入视图的方法,就像编辑笔记时在联系人应用程序中发生的那样.

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.

我的问题是当我在 viewWillAppear 中调用 [someTextView becomeFirstResponder] 时,键盘立即弹出,没有动画.而当我在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 - 让键盘从右侧滑入视图,就像在“通讯录"中编辑笔记时一样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

No resource found that matches the given name: attr #39;android:keyboardNavigationCluster#39;. when updating to Support Library 26.0.0(找不到与给定名称匹配的资源:attr android:keyboardNavigationCluster.更新到支持库 26.0.0 时) - IT屋-程序员软
How to resize UITextView on iOS when a keyboard appears?(出现键盘时如何在iOS上调整UITextView的大小?)
How to reliably detect if an external keyboard is connected on iOS 9?(如何可靠地检测 iOS 9 上是否连接了外部键盘?)
How to mimic Keyboard animation on iOS 7 to add quot;Donequot; button to numeric keyboard?(如何在 iOS 7 上模拟键盘动画以添加“完成数字键盘的按钮?)
How do I dismiss the iOS keyboard?(如何关闭 iOS 键盘?)
Is possible to simulate touch event using an external keyboard on ios jailbroken?(是否可以在 ios 越狱后使用外部键盘模拟触摸事件?)