var win1 = Ti.UI.createWindow({
backgroundColor:'#ff8080'
});
var textFiled = Ti.UI.createTextField({
keyboardType: Titanium.UI.KEYBOARD_DEFAULT,
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
autocapitalization:false,
width:'200dp',
top:'25%'
});
win1.add(textFiled);
textFiled.addEventListener('blur',function(e){
if(textFiled.value === '赤色') win1.setBackgroundColor('#ff0000');
else if(textFiled.value === '黄色') win1.setBackgroundColor('#ffff00');
else if(textFiled.value === '青色') win1.setBackgroundColor('#0000ff');
else win1.setBackgroundColor('#fff');
});
win1.open();
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
0