【问题标题】:How to Hide/Show a text field in titanium alloy?如何隐藏/显示钛合金中的文本字段?
【发布时间】: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
       }
});

有什么建议

【问题讨论】:

标签: javascript titanium titanium-mobile titanium-alloy


【解决方案1】:

查看:

<TextField id="locationText" visible=false hintText="Enter Reason"></TextField>

控制器:

button.addEventListener('singletap', function(e) {
    if(radioGroup.selectedValue == 'Other'){ 
        $.locationText.visible = true;        
    }else{
        $.locationText.visible = false;
    }
});

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2014-09-30
  • 1970-01-01
  • 1970-01-01
  • 2022-01-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-11-21
相关资源
最近更新 更多