分享

android用shape给linearLayout设置边框,怎样只保留底部或顶部的边框,...

 汉江秋月夜 2014-01-07
 

下面是我的测试代码,最终效果LinearLayout有灰色边框,要怎样保留底部或顶部的边框,其它三个方向的边框去掉?
boder.xml
Plain Text code?
1
2
3
4
5
6
7
8
9
10
11
12
13
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas./apk/res/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
Plain Text code?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas./apk/res/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>
 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多