久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

iPhone - UITextView 的問題

iPhone - Problem with UITextView(iPhone - UITextView 的問題)
本文介紹了iPhone - UITextView 的問題的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

這可能是一件容易的事,但我就是想不通——如何結束編輯文本視圖?如何讓鍵盤消失?還是我必須在它外面點擊才能讓它消失?

This is probably an easy thing to do, but I just can't figure it out - how do I end editing athe textview? how can I get the keyboard to disappear? or do I have to click outside it to make it go away?

推薦答案

首先,像這樣一個(說實話)相當簡單的問題讓我想知道您是否嘗試過閱讀文檔或在互聯網上搜索.

First, a (to be honest) fairly simple question like this makes me wonder if you've tried reading the documentation, or searching on the internet.

搜索Apple 文檔 UITextView"為您提供 此鏈接 到類文檔.同樣,這里是文檔UITextViewDelegate.

Searching for "Apple documentation UITextView" gives you this link to the class documentation. Similarly, here is the documentation for the UITextViewDelegate.

搜索UITextView 簡單示例"會為您提供這個有用示例.

Searching for "UITextView simple example" gives you this useful example.

搜索UITextView 關閉鍵盤",第一個點擊似乎是 準確回答您的問題.(盡管他在返回鍵上關閉了鍵盤,這可能不是您想要的.)(編輯 - 從您的第二條評論看來,這正是您想要的.)

Searching for "UITextView dismiss keyboard", the first hit seems to answer your question exactly. (Although he dismisses the keyboard on a return key, which may not be what you want.) (Edit - it seems from your second comment it's exactly what you want.)

附:上面的人是正確的,如果有點簡潔(可以理解).你需要實現一個 UITextViewDelegate.在該委托中,如果您想在返回鍵上隱藏鍵盤,請實現 shouldChangeTextInRange,查找 @" " 并在收到第一響應者時辭職.或者,在您的 UI 中添加完成編輯"按鈕,并在用戶按下它時退出第一響應者.

P.S. The people above are correct, if a little terse (understandably). You need to implement a UITextViewDelegate. In that delegate, if you want to hide the keyboard on a return key, implement shouldChangeTextInRange, look for a @" " and resign first responder if you get it. Alternatively, add a "Done editing" button to your UI, and resign first responder if the user presses it.

這篇關于iPhone - UITextView 的問題的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Find the CGPoint on a UIView rectangle intersected by a straight line at a given angle from the center point(在與中心點成給定角度的直線相交的 UIView 矩形上找到 CGPoint)
Is it possible to reference a variable with a string and an int?(是否可以使用字符串和 int 引用變量?)
Is there a native YAML library for iPhone?(是否有適用于 iPhone 的本機 YAML 庫?)
View aligned to top of keyboard appears in wrong place in iOS 9 Shortcut Bar only mode(在 iOS 9 Shortcut Bar only 模式下,與鍵盤頂部對齊的視圖出現在錯誤的位置)
Disable speech to text button (Micro phone) on soft input keyboard in android programmatically(以編程方式在android中的軟輸入鍵盤上禁用語音到文本按鈕(麥克風))
UIkeyboard type(UI鍵盤類型)
主站蜘蛛池模板: 日韩一区二区在线视频 | 亚洲第一免费播放区 | 美女日批免费视频 | 日韩欧美国产精品一区 | 国产精品视频一区二区三区 | 成人自拍视频网站 | 羞羞网站在线观看 | 青青久久久 | 国产精品久久久久久久久久免费 | 国产成人久久精品一区二区三区 | 国产 日韩 欧美 在线 | 午夜资源 | 久草青青| 国产一级网站 | 91污在线 | 97久久精品午夜一区二区 | 久久免费精品视频 | 欧美一级片在线观看 | 在线看av网址 | 精品久久久久久国产 | 成人综合视频在线 | 羞羞视频免费在线 | 成人在线免费视频 | 久久成人免费视频 | 国产午夜精品一区二区三区四区 | av一级久久 | 中文字幕在线三区 | 精品国产乱码久久久久久丨区2区 | 99精品在线 | 资源首页二三区 | 精品国产区 | 91在线精品一区二区 | 日韩国产在线 | 国产精品一区二区在线 | 日韩av在线不卡 | 秋霞电影院午夜伦 | av综合站 | 亚洲第一福利视频 | 欧美精品综合 | 一区二区三区在线观看免费视频 | 瑟瑟视频在线看 |