UIWebView +键盘
我有一个 UITextView,其下方有一个 UIWebView。 UIWebView 的框架根据 UITextView 设置。框架是动态的,并且在 UItextViewDidChange 方法中不断变化。现在,当触摸 UIWebView 时,键盘就会消失。我不希望这种事发生。键盘应该保留。如果我将 myWebView.userInteractionEnabled = FALSE 设置为 FALSE,我仍然可以从 UIWebView 复制文本吗?
I have a UITextView which has a UIWebView just below it. The frame of UIWebView is set depending on the UITextView. The frames are dynamic and keep changing in UItextViewDidChange method. Now, when the UIWebView is touched, the keyboard is dismissed. I don't want that to happen. The keyboard should stay. If I turn myWebView.userInteractionEnabled = FALSE, will I still be able to copy text from UIWebView.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道你是否还能复制文本,我想不能。但这里是如何处理它的。
在你的touchesBegan方法中放置这个if语句
//从touches集中获取touch对象。
theTextField 是负责显示键盘的对象。
希望这有帮助。
I don't know if you still be able to copy text, I think not. But here is how to deal with it.
In your touchesBegan method put this if statement
//Get the touch object from touches set.
the theTextField is the object responsible for displaying the keyboard.
Hope this helps.
当 UIWebview 被触摸时,它将关闭键盘。如果您设置
WebView.userInteractionEnabled = FALSE
键盘将不会关闭,并且您将无法从 UIWebView 复制文本。希望有帮助。
When UIWebview is touched it will dismiss the keyboard. if you set
WebView.userInteractionEnabled = FALSE
keyboard won't dismiss and you won't be able to copy text from UIWebView.Hope it helps.