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.
我有一个包含 12 个元素的 GridView。
View v; v.setBackgroundColor(Color.rgb(0, 107, 179));
我需要前 6 个元素具有特定颜色,其余 6 个元素具有另一种颜色。
是否可以?
我自己回答:
if (position < 6) v.setBackgroundColor(Color.rgb(0, 107, 179)); else v.setBackgroundColor(Color.rgb(0,91,153));