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.
我使用下面的代码来设置分隔网格单元格的线:
GridView gv = (GridView)findViewById(gridview id); gv.setVerticalSpacing(3); gv.setHorizontalSpacing(3); gv.setAdapter(Adapter);
它只设置线宽,但不显示不同的颜色。 如何设置不同的颜色线?
你不能用网格来做到这一点。您必须删除分隔符并向视图添加边框,您可以为每个视图更改该边框。