<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文本对齐问题

        UItextfield text alignment issue in cocos2D iPhone(cocos2D iPhone中的UItextfield文本对齐问题)
          <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文本对齐问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)
                  [ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)
                    <tbody id='NyFDp'></tbody>

                  <tfoot id='NyFDp'></tfoot>
                  <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>

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