【发布时间】:2015-08-28 19:13:34
【问题描述】:
我想在我的 RableRow 周围创建一个边框。 我使用以下形状作为背景。
bg_stroke_dotted_right
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:top="-4dp"
android:left="-2dp"
android:bottom="-4dp"
android:drawable="@drawable/stroke_dotted">
</item>
</layer-list>
stroked_dotted 可绘制对象
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#000000" />
<stroke
android:dashGap="4dp"
android:dashWidth="2dp"
android:width="2dp"
android:color="@color/greyDark" />
</shape>
我不明白为什么使用“bg_stroke_dotted_right”作为 bg - 用黑色归档背景。 一旦我将“bg_stroke_dotted_right”添加为 bg - bg 就会变成黑色。
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_stroke_dotted_right"
>
【问题讨论】:
标签: android layout background border