Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text in Textfield starts in Middle of TextField IOS

Hello the placeholder text, and the text the user inputs, starts in the middle of my textfield. I have the textfield as 30% of the screen height, so I can't simply make the textfield smaller. How do I make the text start in the top left corner?

like image 573
androidcoder1234 Avatar asked Apr 01 '17 02:04

androidcoder1234


1 Answers

What you want to do is both a horizontal and vertical alignment like this:

textField.textAlignment = .left
textField.contentVerticalAlignment = .top

Result:

like image 144
Rashwan L Avatar answered Sep 20 '22 23:09

Rashwan L