问题使用cocos2dx ui :: TextField:textfield在Android设备中显示不正确

时间:2015-11-03 11:00:04

标签: cocos2d-x cocos2d-x-3.0

  

textfield只显示android我文本字段中的顶部上方正在工作   适当的ios设备但Android设备它显示上部顶部我   附上截图

auto namewithPlates =  ui::Scale9Sprite::create("text_field.png");
        namewithPlates->setAnchorPoint(Point(.53,.5));


        auto tempplt =  ui::Scale9Sprite::create("text_field.png");
        tempplt->setScale(ratinaScaleX);

        f_editemail = ui::EditBox::create(tempplt->getBoundingBox().size, namewithPlates);



        f_editemail->setPosition(Point(plates->getPosition().x,signwithPlates->getPosition().y-signwithPlates->getBoundingBox().size.height/2 -tempplt->getBoundingBox().size.height/2));//added 11 Aug 2015s



        f_editemail->setFont(fRockoUltraFLFBold, 20*ratinaScaleX);//Added 11 Aug 2015
        f_editemail->setPlaceholderFont(fRockoUltraFLFBold, 20*ratinaScaleX);//Added 11 Aug 2015
        f_editemail->setPlaceHolder("Email");
        f_editemail->setPlaceholderFontColor(Color3B::RED);
        f_editemail->setFontColor(TextColor);////Added 11 Aug 2015
        mainLayer->addChild(f_editemail);
        f_editemail->setLocalZOrder(4);//added 10 Aug 2015
        f_editemail->setReturnType(ui::EditBox::KeyboardReturnType::DONE);
    auto namewithPlates =  ui::Scale9Sprite::create("text_field.png");
        namewithPlates->setAnchorPoint(Point(.53,.5));


        auto tempplt =  ui::Scale9Sprite::create("text_field.png");
        tempplt->setScale(ratinaScaleX);

        f_editemail = ui::EditBox::create(tempplt->getBoundingBox().size, namewithPlates);



        f_editemail->setPosition(Point(visibleSize/2));//added 11 Aug 2015s



        f_editemail->setFont(fRockoUltraFLFBold, 20*ratinaScaleX);//Added 11 Aug 2015
        f_editemail->setPlaceholderFont(fRockoUltraFLFBold, 20*ratinaScaleX);//Added 11 Aug 2015
        f_editemail->setPlaceHolder("Email");
        f_editemail->setPlaceholderFontColor(Color3B::RED);
        f_editemail->setFontColor(TextColor);////Added 11 Aug 2015
        mainLayer->addChild(f_editemail);
        f_editemail->setLocalZOrder(4);//added 10 Aug 2015
        f_editemail->setReturnType(ui::EditBox::KeyboardReturnType::DONE);
    }

1.image1是ios screenshot enter image description here

2.image2是Android设备enter image description here

0 个答案:

没有答案