Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set text position to bottom in textField

I created a textField through code using the following code

UITextField *txtObj=[UITextField alloc]initWithFrame:CGRectMake(88,100,80,33)];

I am getting the textfield as i planned, but the text we type in that text field seems to appear in the top area of text but not in bottom.I tried to align it but i got tired. Can anyone tell me what's the solution

like image 305
surendher Avatar asked Jan 18 '12 07:01

surendher


1 Answers

it should be:

txtObj.contentVerticalAlignment = UIControlContentVerticalAlignmentBottom;

This property is inherited from the UIControl class. The default is: UIControlContentVerticalAlignmentTop , that's why you get the text on top.

like image 101
The dude Avatar answered Oct 14 '22 07:10

The dude