在自定义视图上显示弹出菜单时不要关闭键盘
我创建了自己的 UIView 子类来向用户呈现文本信息。用户可以双击该视图来弹出“复制”菜单。问题是同一视图控制器中的 UITextView 放弃其第一响应者状态,从而在弹出菜单出现时关闭键盘。我该如何避免这种情况?我希望我的应用程序的行为类似于标准 iPhone 的消息应用程序:双击消息气泡时键盘不会消失,会显示一个弹出菜单。
I created my own UIView subclass to present text information to the user. User is able to double tap this view to popup a 'Copy' menu. The problem is that UITextView within the same view controller resigns its first responder status thus dismissing keyboard when popup menu is presented. How do I avoid this? I want my application to behave like standard iPhone's Messages application: keyboard is not dismissed while double tapping on message bubble presents a popup menu.
保留 UITextView 的引用。并在消息气泡的选择器中首先创建文本视图
响应者例如-
popUpclicked{
[textView 成为firstResponder]
}
或将 userinteractionEnable 属性设置为 NO 可能会起作用...
keep the refrence of UITextView . and in selector of message bubble make text view first
responder eg-
popUpclicked{
[textView becomefirstResponder]
}
or make userinteractionEnable property to NO may be it work...