cocos2D iPhone中的UItextfield文本对齐问题

SST*_*SST 2 iphone uikit cocos2d-iphone

请看下面的截图.

替代文字http://img442.imageshack.us/img442/8027/img0402k.png

这是我的代码,我使用的是cocos2D

CGAffineTransform transform = CGAffineTransformMakeRotation(3.14159/2);  
_view = [[CCDirector sharedDirector]openGLView];

 // Input the user name
_nameField = [[UITextField alloc]initWithFrame:CGRectMake(130.0, 270.0, 200.0, 30.0)];
_nameField.transform = transform;
_nameField.adjustsFontSizeToFitWidth = YES;
_nameField.textColor = [UIColor blackColor];
[_nameField setFont:[UIFont fontWithName:@"Arial" size:14]];
_nameField.placeholder = @"<Enter Your Name>";
_nameField.backgroundColor = [UIColor clearColor];
_nameField.autocorrectionType = UITextAutocorrectionTypeNo;
_nameField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters;
_nameField.textAlignment = UITextAlignmentCenter;
_nameField.keyboardType = UIKeyboardTypeDefault;
_nameField.returnKeyType = UIReturnKeyDone;
_nameField.tag = 0;
_nameField.delegate = self;
_nameField.clearButtonMode = UITextFieldViewModeNever;
_nameField.borderStyle = UITextBorderStyleRoundedRect;

[_view addSubview:_nameField];
Run Code Online (Sandbox Code Playgroud)

问题是文本与文本字段的顶部对齐.我希望它在中间而不是顶部.底部有太多空间.

请指教我的方式.

Jef*_*f B 11

这不应该工作吗?

_nameField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
Run Code Online (Sandbox Code Playgroud)