Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITextField start text from top when height is increased

I have increased the height of UITextField. The problem is that although height is increased, the text still starts from center of textFeild. But I want text to appear from top of UITextField.

like image 977
Nitish Avatar asked Feb 14 '12 16:02

Nitish


2 Answers

you can use this...

textField.contentVerticalAlignment = UIControlContentVerticalAlignmentTop;
like image 137
Aravindhan Avatar answered Nov 15 '22 13:11

Aravindhan


textField.contentVerticalAlignment = UIControlContentVerticalAlignment.top

The above code has worked for me. I am using Xcode 9. Hope it works for you !

like image 21
Zahurafzal Mirza Avatar answered Nov 15 '22 12:11

Zahurafzal Mirza