![](/img/trans.png)
[英]How to create a UITextView or a UITextField that has a placeHolder, multiline and vertically centered?
[英]How can I create a UITextView that expands vertically as required?
我正在嘗試創建一個需要可擴展 UITextView 的 iphone 應用程序。 我正在尋找類似於聯系人應用程序中用於添加筆記的功能的東西。
UITextView 是 UIScrollView 的子類,因此它應該可以使用contentSize
屬性來找出內容的尺寸並相應地調整視圖的大小。 為了在用戶編輯時做出正確反應,您應該能夠使用委托的textViewDidChange:
方法來觸發大小更新。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.