UITextField多行 [英] UITextField multiple lines

查看:113
本文介绍了UITextField多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道是否可以在XCode中的UITextField中使用多行。我知道如何增加身高。但是我知道它的线路:/

Just wonder if it is possible to use multiple lines in UITextField in XCode. I know how to increase the height size. but have know idea about its lines :/

推荐答案

好的我用一些技巧做了;)首先制作了一个UITextField并增加了它大小如下:

Ok I did it with some trick ;) First made a UITextField and increased it's size like this :

CGRect frameRect = textField.frame
frameRect.size.height = 53
textField.frame = frameRect

然后我在与我制作UITextField相同的区域制作了一个UITextView,删除了它的背景颜色。现在看起来我有多行TextField!

Then I made a UITextView exactly in the same area that i made my UITextField, and deleted its background color. Now it looks like that I have a multiple lines TextField !

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

这篇关于UITextField多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆