Titanium 钛API Textfield倍增

Titanium 钛API Textfield倍增,titanium,Titanium,我的应用程序中有一个文本字段,它在文本上加倍。我的意思是,如果我输入“dog”,它返回“dogDog”,注意它是如何大写的 var searchText = Ti.UI.createTextField({ borderRadius:5, hintText : 'Enter Search Text', color:"#0000FF", borderColor:"#0000FF", font:{fontSize: 30}, wi

我的应用程序中有一个文本字段,它在文本上加倍。我的意思是,如果我输入“dog”,它返回“dogDog”,注意它是如何大写的

var searchText = Ti.UI.createTextField({
      borderRadius:5,
      hintText : 'Enter Search Text',
      color:"#0000FF",
      borderColor:"#0000FF",
      font:{fontSize: 30},
      width:400,
      top:50
});
searchText.addEventListener('return',textEntered);

function textEntered(){
 Titanium.API.info(searchText.getValue());// logs "dogDog" when should be "dog"
}

使用随事件一起发送的属性。(doc)


请具体说明。你想要什么?当您输入“dog”时,您希望在日志中显示“dogDog”。'我说得对不对?
searchText.addEventListener('return',textEntered);

function textEntered(source,type,value){
    Titanium.API.info(value); // should just log 'dog'
    // var type should contain 'return'
    // var source should contain the searchText object.
}