绘制圆角的 LinearLayout(.xml)
先在drawable新建一个blackground.xml
代码如下:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!--背景颜色-->
<solid android:color="#fff" />
<!--分别设置左上,右上,左下,右下-->
<corners
android:bottomLeftRadius="5px"
android:bottomRightRadius="5px"
android:topLeftRadius="5px"
android:topRightRadius="5px" />
</shape>
然后是LinearLayout 里面的使用
代码如下:
<LinearLayout
android:id="@+id/bangding_alipay"
android:layout_width="fill_parent"
android:layout_height="45dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="20dp"
android:layout_weight="1"
android:background="@drawable/blackground"
android:gravity="center" >
</LinearLayout>
然后显示出来的就是圆角的背景了