【View】isShown ()的用法

来源:互联网 发布:网络布线按米收费吗 编辑:程序博客网 时间:2024/05/16 01:21

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本身而不对祖先的可见性进行判断

0 0