使用软件PersimmonUIBuilder新建了一个页面如下:

按钮Clock用于隐藏和显示 Clock控件,修改MENU按钮的字符。
效果如下面两个图片


结论就是Clock控件设置为隐藏时并未被隐藏。代码如下:
onBtnClock:function(event){
clock_hide = !clock_hide;
//this.setData({Clock1:{hide:clock_hide}});
//this.setData({btnMENU:{hide:clock_hide}});
if(clock_hide)
{
this.setData({Clock1:{hide:true,refresh:true}});
this.setData({btnMENU:{value:'Hide',refresh:true}});
}
else
{
this.setData({Clock1:{hide:false,refresh:true}});
this.setData({btnMENU:{value:'Show',refresh:true}});
}
console.log('clock_hide=' + clock_hide);
this.draw();
},
问题出在哪里呢?
好的,谢谢。