简体   繁体   English

如何创建多行UITextField?

[英]How to create a multi-line UITextField?

How can I implement a multiple line textfield like what I see in the iPhone messaging application. 如何实现多行文本字段,就像我在iPhone消息传递应用程序中看到的那样。 in other words, How to expand the box dynamically when user press return key or when text run to next line. 换句话说,当用户按下返回键或文本运行到下一行时,如何动态扩展该框。 I notice this question already been asked at: 我注意到已经在以下位置问过这个问题:

Objective C: How to create a multi-line UITextField? 目标C:如何创建多行UITextField?

and the solution was to use UITextView, however, UITextView doesn't look as deli gent as UITextView because it doesn't show border depth as UITextView. 解决方案是使用UITextView,但是UITextView看起来不像UITextView那样精致,因为它不像UITextView那样显示边框深度。

regards, 问候,

您可以使用不带边框的UITextView,并在上面放置一些UIImageViews作为您自己的边框。

You can find my answer for that here : 您可以在这里找到我的答案:

https://stackoverflow.com/a/13476467/1572408 https://stackoverflow.com/a/13476467/1572408

hope it help :) 希望对您有所帮助:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM