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 :/
Asked
Active
Viewed 5.9k times
3 Answers
6
Ok I did it with some trick ;) First made a UITextField and increased it's size like this:
var frameRect: CGRect = textField.frame
frameRect.size.height = 53
textField.frame = frameRect
Then I made a UITextView exactly in the same area that I made my UITextField, and deleted its background colour. Now it looks like that I have a multiple lines TextField!
5
Unfortunately, UITextField is specifically one-line only. You will need to use a UITextView instead of UITextField for displaying and editing multiline text; it will be multiline by default.

jszaday
- 322
- 1
- 4
- 12
-
but the problem is that i have problem with how UITextView looks like ! thanks anyway :) – Rudi Nov 20 '12 at 15:07
-
You can add UIImageView with needed image behind your UITextView. And set clearColor for text view. – EugeneK Nov 20 '12 at 15:58