【发布时间】:2014-10-14 16:25:20
【问题描述】:
是否有任何方法可以根据所选输入显示/隐藏文本字段。我有一个单选按钮问题如果用户从该问题中选择其他选项,那么我需要显示一个文本框来输入值。有没有可能。
查看
<TextField id="locationText" hintText="Enter Reason"></TextField>
风格:
"#locationText": {
width: '90%',
top: '25dp',
height: 40
}
控制器:
button.addEventListener('singletap', function(e) {
if(radioGroup.selectedValue == 'Other')
{
// Here I need to show the text field, If the selected value is not Other the text field should be hidden
}
});
有什么建议
【问题讨论】:
-
设置不透明度为0然后使用fadeIn方法? docs.appcelerator.com/titanium/3.0/#!/api/…
-
为什么不使用隐藏和显示功能? docs.appcelerator.com/titanium/3.0/#!/api/…
-
首先将属性
visible设置为false,然后选择单选按钮。切换visible属性。 docs.appcelerator.com/titanium/3.0/#!/api/… -
如何使用可见属性作为切换
-
@Precious View :
控制器 : button.addEventListener('singletap', function(e) { if( radioGroup.selectedValue == 'Other') { $.locationText.visible = true; }else{ $.locationText.visible = false; } });
标签: javascript titanium titanium-mobile titanium-alloy