【android】view.isShown ()的用法
來源:程序員人生 發布時間:2014-12-28 12:28:14 閱讀次數:11883次
先看官方說明:
public boolean isShown ()
Added in API level 1
Returns the visibility of this view and all of its ancestors
Returns
- True if this view and all of its ancestors are
VISIBLE
也就是只有當view本身和它的所有先人們都是visible時,isShown()才返回TRUE。
而平常我們調用if(view.getVisibility() == View.VISIBLE)只是對view本身而不對先人的可見性進行判斷。
生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈