您的位置:首页 > 移动开发 > Android开发

Android开发----ListView去掉默认分割线 并且加上圆角

2017-10-26 15:34 609 查看
1.divider设置为@null

[html] view
plain copy

<ExpandableListView  

    android:id="@+id/lv_content"  

    android:layout_width="match_parent"  

    <span style="background-color: rgb(204, 0, 0);">android:divider="@null"</span>  

    android:layout_height="match_parent" >  

</ExpandableListView>  

2.divider设置颜色#00000000

[html] view
plain copy

<ExpandableListView  

    android:id="@+id/lv_content"  

    android:layout_width="match_parent"  

    <span style="background-color: rgb(204, 0, 0);">android:divider="#00000000"</span>  

    android:layout_height="match_parent" >  

</ExpandableListView>  

3.设置圆角的办法

   

在drawable目录下添加borad_radio.xml,设置控件的边框代码。如下:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#CE0000"/>
<corners
android:radius="6dp" />
</shape>


调用样式只要设置控件的android:background="@drawable/border_radio"  即可

效果如下图
















                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: