<bdo id='ijwGg'></bdo><ul id='ijwGg'></ul>
    <tfoot id='ijwGg'></tfoot>
      <i id='ijwGg'><tr id='ijwGg'><dt id='ijwGg'><q id='ijwGg'><span id='ijwGg'><b id='ijwGg'><form id='ijwGg'><ins id='ijwGg'></ins><ul id='ijwGg'></ul><sub id='ijwGg'></sub></form><legend id='ijwGg'></legend><bdo id='ijwGg'><pre id='ijwGg'><center id='ijwGg'></center></pre></bdo></b><th id='ijwGg'></th></span></q></dt></tr></i><div id='ijwGg'><tfoot id='ijwGg'></tfoot><dl id='ijwGg'><fieldset id='ijwGg'></fieldset></dl></div>

      <small id='ijwGg'></small><noframes id='ijwGg'>

        <legend id='ijwGg'><style id='ijwGg'><dir id='ijwGg'><q id='ijwGg'></q></dir></style></legend>
      1. cocos2D iPhone中的UItextfield文本对齐问题

        时间:2024-08-12
          <bdo id='SZBRG'></bdo><ul id='SZBRG'></ul>
          <legend id='SZBRG'><style id='SZBRG'><dir id='SZBRG'><q id='SZBRG'></q></dir></style></legend>

        • <small id='SZBRG'></small><noframes id='SZBRG'>

          <tfoot id='SZBRG'></tfoot>

                <i id='SZBRG'><tr id='SZBRG'><dt id='SZBRG'><q id='SZBRG'><span id='SZBRG'><b id='SZBRG'><form id='SZBRG'><ins id='SZBRG'></ins><ul id='SZBRG'></ul><sub id='SZBRG'></sub></form><legend id='SZBRG'></legend><bdo id='SZBRG'><pre id='SZBRG'><center id='SZBRG'></center></pre></bdo></b><th id='SZBRG'></th></span></q></dt></tr></i><div id='SZBRG'><tfoot id='SZBRG'></tfoot><dl id='SZBRG'><fieldset id='SZBRG'></fieldset></dl></div>
                  <tbody id='SZBRG'></tbody>
                1. 本文介绍了cocos2D iPhone中的UItextfield文本对齐问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  请看下面的屏幕截图.

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

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

                  Here is my code, I am using 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];
                  

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

                  The problem is the text is aligned to the top of the text field. I want it to be in the middle not to top. There is too much space in the bottom.

                  请给我建议.

                  推荐答案

                  这不应该行吗?

                  _nameField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
                  

                  这篇关于cocos2D iPhone中的UItextfield文本对齐问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:从 Documents 目录存储和读取文件 iOS 5 下一篇:Cocos2d - 对 CCSprite 应用 GLImageProcessing 效果

                  相关文章

                  <tfoot id='NyFDp'></tfoot>
                2. <i id='NyFDp'><tr id='NyFDp'><dt id='NyFDp'><q id='NyFDp'><span id='NyFDp'><b id='NyFDp'><form id='NyFDp'><ins id='NyFDp'></ins><ul id='NyFDp'></ul><sub id='NyFDp'></sub></form><legend id='NyFDp'></legend><bdo id='NyFDp'><pre id='NyFDp'><center id='NyFDp'></center></pre></bdo></b><th id='NyFDp'></th></span></q></dt></tr></i><div id='NyFDp'><tfoot id='NyFDp'></tfoot><dl id='NyFDp'><fieldset id='NyFDp'></fieldset></dl></div>
                    <bdo id='NyFDp'></bdo><ul id='NyFDp'></ul>
                  <legend id='NyFDp'><style id='NyFDp'><dir id='NyFDp'><q id='NyFDp'></q></dir></style></legend>

                    1. <small id='NyFDp'></small><noframes id='NyFDp'>