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.
我有一个打勾的图像。目前我知道如何使用 GONE/VISIBLE 设置可见性。
tick.setVisibility(View.VISIBLE);
我希望能够使用 if 语句检测图像是否可见。
if (tick is visible){ i++ }
谢谢
if (View.VISIBLE == tick.getVisibility()) { i++; }
试试这个代码,它会帮助你。
if (ticket.getVisiblity() == View.VISIBLE) { i++; }