开发者

how to show dotted border to table layout

开发者 https://www.devze.com 2023-02-20 19:58 出处:网络
I am new in android, want to show border in ta开发者_如何学运维blelayout. can any one please help me, it is very critical for me.Try setting a ShapeDrawable as the background of the elements you want

I am new in android, want to show border in ta开发者_如何学运维blelayout.

can any one please help me, it is very critical for me.


Try setting a ShapeDrawable as the background of the elements you want a border on. You can define a ShapeDrawable in an XML file in your res/drawables folder. In particular, the stroke element has the dashWidth and dashGaps parameters that let you make a dashed line:

<stroke
    android:width="integer"
    android:color="color"
    android:dashWidth="integer"
    android:dashGap="integer" />

You can also just set a repeating dots image as the background of the entire table, then set a solid background and margin on the cells (see this trick, which is written about solid borders but I'm sure you can fake with a 2x2 repeating bitmap of a checkerboard pattern).

0

精彩评论

暂无评论...
验证码 换一张
取 消