android用shape给linearLayout设立边框,怎样只保留底部或顶部的
展开全部
方法如下:
boder.xml
< xml version="1.0" encoding="utf-8" >
<shape xmlns:android="" >
<stroke
android:width="0.01dp"
android:color="#C6C7CE" />
<padding
android:bottom="5dp"
android:top="5dp"
android:left="5dp"
android:right="5dp" />
</shape>
text.xml
< xml version="1.0" encoding="utf-8" >
<LinearLayout xmlns:android=""
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="vertical" android:gravity="center"
android:background="@drawable/boder" >
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content"
android:text="@string/log_name"/>
</LinearLayout>
</LinearLayout>
转载 仅供参考
boder.xml
< xml version="1.0" encoding="utf-8" >
<shape xmlns:android="" >
<stroke
android:width="0.01dp"
android:color="#C6C7CE" />
<padding
android:bottom="5dp"
android:top="5dp"
android:left="5dp"
android:right="5dp" />
</shape>
text.xml
< xml version="1.0" encoding="utf-8" >
<LinearLayout xmlns:android=""
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="vertical" android:gravity="center"
android:background="@drawable/boder" >
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content"
android:text="@string/log_name"/>
</LinearLayout>
</LinearLayout>
转载 仅供参考
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询