iphone - UITextView 没有成为 iOS 7 中的第一响应者

标签 iphone objective-c uitextfield ios7 uitextview

我正在使用以下 control在 View Controller 中,我想在用户打开 View 时显示键盘,所以我尝试从 View Controller 调用此方法

[self.inputToolbar.textView becomeFirstResponder];

但是打开 View 时键盘不显示。所以我在分配textview的地方调用了becomefirstresponder you can see the allocation page here我这样打电话

[internalTextView becomeFirstResponder];

现在它在 iOS6 中可用,但在 iOS7 中它不可用

最佳答案

通过使用示例代码
我在 UIInputToolbarViewController.m > loadView

中写了下面的代码
[self.inputToolbar.textView.internalTextView becomeFirstResponder];

而且它工作正常。
代码

enter image description here

关于iphone - UITextView 没有成为 iOS 7 中的第一响应者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19315060/

相关文章:

iphone - 如何检测 UITableView 上的 "quick touch"以便切换到全屏或从全屏切换?

iphone - 代码签名错误: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain

iPhone:UITextField 结束编辑事件不会隐藏键盘

objective-c - 如何格式化 NSTextField 或 UITextField?

ios - 如何在 Objective C 中创建带有标签和文本字段的自定义单元格

iphone - Interface Builder 中的 UITabBarControllers 遇到问题

iphone - 应用程序在iPhone 4s上崩溃,但没有其他设备:SKPhysicsContactDelegate可能出现问题?

ios - 从用户输入的属性字符串中查找属性

objective-c - Objective-C : Issue in calculating height of individual labels

objective-c - Swift 3 或 Objective C 中的水平日历 View