【问题标题】:as3 StageText cursor does not show upas3 StageText 光标不显示
【发布时间】:2013-03-27 12:01:48
【问题描述】:

这里是创建 StageText 的代码

var myTextField:StageText = new StageText();
myTextField.returnKeyLabel = ReturnKeyLabel.SEARCH;
myTextField.text = tlf.text;
myTextField.editable = true;
myTextField.fontFamily = "Ariel"
myTextField.fontSize = 40;
myTextField.color =  tlf.textColor
myTextField.textAlign = TextFormatAlign.RIGHT
myTextField.stage = stage;
myTextField.viewPort = new Rectangle(p.x,  p.y, tlf.width*screenUtil.xScaleFactor,tlf.height*screenUtil.yScaleFactor);
txtInputVo.stageText = myTextField;
myTextField.locale = "he-IL";
myTextField.addEventListener(FocusEvent.FOCUS_IN, onInFocus);
myTextField.addEventListener(FocusEvent.FOCUS_OUT, onOutFocus);
protected function onInFocus(event:FocusEvent):void
{
    var sTxt:StageText = event.currentTarget as StageText;
    var textInputVo:TextInputVO =  getTextInputVO(sTxt);
    if(textInputVo.defultText == sTxt.text)
    {
        sTxt.text = "";
    }
}

效果很好,键盘出现了,您可以插入和编辑文本 但光标没有出现?

目前我只在 Android Air 3.6 上测试过。

【问题讨论】:

  • 我注意到您的代码正在侦听要触发的事件,但我没有看到您在哪里向任何对象添加了事件侦听器?例如,myTextField.addEventListener(FocusEvent.FOCUS_IN, onInFocus);
  • 我有原始代码,我会在捕捉时添加它谢谢
  • 你有没有试过使用StageText对象的assignFocus()函数来查看光标是否出现?例如,尝试添加一个用于调试目的的函数,将焦点分配给myTextField。 IE。 myTextField.assignFocus(); 另外我相信这行代码if(textInputVo.defultText == sTxt.text) 应该是if(textInputVo.defaultText == sTxt.text)
  • StageText 和 RTL 的另一个问题 bugbase.adobe.com/index.cfm?event=bug&id=3537430

标签: android actionscript-3 mobile air adobe


【解决方案1】:

尝试“Arial”而不是“Ariel”作为字体系列

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-05-22
    • 1970-01-01
    • 1970-01-01
    • 2017-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多