我在我的应用程序中有一个TextField,它在文本上加倍。我的意思是,如果我输入"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"
}发布于 2012-08-09 20:20:25
使用与事件一起发送的属性。(文档http://docs.appcelerator.com/titanium/2.1/#!/api/Titanium.UI.TextField-event-return)
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.
}https://stackoverflow.com/questions/11871048
复制相似问题