如何摆脱expandableListView Android的尖角?

时间:2015-08-13 08:58:05

标签: android

我使用了expandableListView,如图所示,我还为expandableListView添加了一个边框,但是即使在应用边框后,尖角仍然可见。如何隐藏边界后面的那些尖角(红色正方形)?enter image description here

我的ExpandableListview xml

<RelativeLayout
        android:layout_width="wrap_content"
        android:paddingRight="20dp"
        android:paddingLeft="20dp"
        android:paddingTop="8dp"
        android:layout_below="@+id/relativeLayout1"
        android:layout_height="match_parent">

        <ExpandableListView
            android:layout_width="wrap_content"
            android:divider="@android:color/transparent"
            android:groupIndicator="@null"
            android:layout_height="wrap_content"
            android:background="@drawable/border"
            android:id="@+id/expandableListViewwrittensales"
            android:layout_centerHorizontal="true"
            android:layout_below="@+id/relativeLayout" />


    </RelativeLayout>

和Border xml。

<?xml version="1.0" encoding="utf-8"?>
<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >

    <!-- view background color -->


    <!-- view border color and width -->
    <stroke
        android:width="3dp"
        android:color="#D1D0CE" >
    </stroke>

    <!-- If you want to add some padding -->
    <padding
        android:left="3.5dp"
        android:top="3.5dp"
        android:right="3.5dp"
        android:bottom="3.5dp"    >
    </padding>

    <!-- Here is the corner radius -->
    <corners
        android:radius="8dp"   >
    </corners>

</shape>

1 个答案:

答案 0 :(得分:0)

尝试在顶层绘制边框。

<RelativeLayout
        android:layout_width="wrap_content"
        android:paddingRight="20dp"
        android:paddingLeft="20dp"
        android:paddingTop="8dp"
        android:layout_below="@+id/relativeLayout1"
        android:layout_height="match_parent">

        <ExpandableListView
            android:layout_width="wrap_content"
            android:divider="@android:color/transparent"
            android:groupIndicator="@null"
            android:layout_height="wrap_content"
            android:id="@+id/expandableListViewwrittensales"
            android:layout_centerHorizontal="true"
            android:layout_below="@+id/relativeLayout" />


<View
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/border"
        android:layout_alignParentBottom="true"
        android:layout_alignTop="@+id/expandableListViewwrittensales"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

    </RelativeLayout>