I add textfield in layer like this.
UITextField *name = [[UITextField alloc] initWithFrame:CGRectMake(142, 214 , 36, 152)];
name.textColor = [UIColor blueColor];
name.textAlignment = UITextAlignmentLeft;
//name.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
name.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
name.clearsOnBeginEditing = YES;
name.borderStyle = UITextBorderStyleRoundedRect;
name.delegate = self;
name.returnKeyType = UIReturnKeyDone;
name.autocorrectionType = UITextAutocorrectionTypeNo;
name.autocapitalizationType = UITextAutocapitalizationTypeWords;
//[name addTarget:self action:@selector(backgroundTouch:) forControlEvents:UIControlEventEditingDidEndOnExit];
[[[Director sharedDirector] openGLView] addSubview: name];
However, I found textfield's content Alignment is contentVerticalAlignment. I need to set HorizontalAlignment?
Please help me!
Thinks!