2012年5月28日 星期一

titanium visible, show, hide



Though hide() & show() are handled appropriately in views, the state of the property 'visible' is never changed. If you pass visible: false in the createXXX() method, it will be respected and used (the view will be hidden), but the value of .visible never changes again even after calling show().

這句話的意思大概是當使用hide/show()時
元件的visible屬性並沒有變化
例如建立一個 xxx {visible:false}後,使用xxxx.show()
這時去檢查visible也依然是false
所以別用visible檢查元件是否為可視狀態
要檢查可視狀態的話,另外設定一個bool值處理(好像有看過人這麼建議?)

是說Titanium好歹也提供一個toggle指令吧..

沒有留言: