Gridlayout with borders

Deadly 提交于 2021-02-08 14:14:37

问题


I'm a new Android developer, and I'm just trying to improve my skill by reading some samples, I want to design a new interface using GridLayout, I've checked a lot of samples but I can't seem to draw borders between the GridLayout cells. What could I be missing?

Here is a link that I went through it, but the borders didn't show up!

http://developer.samsung.com/android/technical-docs/GridLayout-in-Android#

I appreciate your care in advance.


回答1:


Android Layout containers don't draw borders. Still:

  1. You can set background of each cell's View to an xml Drawable resource, which describes a transparent rectangle with borders.

  2. Give a background color to GridView's parent View, and set each GridView cell View's background to a different color.

Both of these can also be applied as a Style.



来源:https://stackoverflow.com/questions/13776547/gridlayout-with-borders

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!