通过如下设置,轻松给TextView的上下左右添加边框,很简单,你懂的,对不对?
-
<TextView
-
android:id="@+id/me_agreement"
-
style="@style/text_black_big"
-
android:layout_width="fill_parent"
-
android:layout_height="wrap_content"
-
android:layout_centerVertical="true"
-
android:gravity="center"
-
android:background="@drawable/setbar_bg"
-
android:layout_marginTop="10dip"
-
android:paddingTop="5dip"
-
android:text="上边框" />
res/drawable/setbar_bg.xml
-
<?xml version="1.0" encoding="utf-8"?>
-
<layer-list xmlns:android="" >
-
<item>
-
<shape>
-
<solid android:color="#FFBBBBAA" />
-
</shape>
-
</item>
-
-
<item android:top="2dp">
-
<shape>
-
<solid android:color="#FFFFFFFF" />
-
</shape>
-
</item>
-
</layer-list>
top/bottom/left/right
阅读(7456) | 评论(0) | 转发(0) |