Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我搜索但无法得到答案
我这样称呼admob:
AdView adView = (AdView)this.findViewById(R.id.ad); adView.loadAd(new AdRequest());
好的,但是我怎样才能使 admob 不可见呢?(包括视图) 并且以后可以再次启用吗?
adView.setVisibility(View.GONE);
编辑:您也可以将其设置为.和adView.setVisibility(View.INVISIBLE);之间的区别在于从布局中完全删除视图,同时“保存”该视图占用的空间。INVISIBLEGONEGONEINVISIBLE
adView.setVisibility(View.INVISIBLE);
INVISIBLE
GONE