带边框的网格布局 [英] Gridlayout with borders

查看:83
本文介绍了带边框的网格布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名新的Android开发人员,我只是想通过阅读一些示例来提高自己的技能,我想使用GridLayout设计一个新的界面,我检查了很多示例,但是我似乎无法在GridLayout单元之间绘制边框.我可能会缺少什么?

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.

推荐答案

Android布局容器不绘制边框.仍然:

Android Layout containers don't draw borders. Still:

  1. 您可以将每个单元格视图的背景设置为xml Drawable资源,描述了一个带边框的透明矩形.

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

为GridView的父视图提供背景颜色,并将每个GridView单元格View的背景设置为不同的颜色.

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.

这篇关于带边框的网格布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆