1

当焦点或长按这种方式时,我的列表视图会删除他的边框

图片

下面是我的列表视图代码请帮助我为什么在焦点时删除边框??? 一切都很好只有列表视图边框会在长按时删除

我编辑我的代码请现在检查

  <LinearLayout
 android:id="@+id/lytContent"
 android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 android:layout_marginLeft="10dp"
 android:layout_marginRight="10dp"
 android:background="@drawable/layout_border"
  android:orientation="vertical" >

  <ListView
    android:id="@+id/listMainMenu2"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:dividerHeight="1dip"
    android:fadeScrollbars="true"
    android:listSelector="@drawable/listview_selector" />

 </LinearLayout>       

<-----listview_selector.xml---->

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

 <item
    android:drawable="@drawable/listviewborder"
    android:state_focused="true"/>
 <item
    android:drawable="@drawable/listview_selector_pressed"
    android:state_pressed="true"/>

 </selector>               

<-----listviewborder.xml----->

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

<item>
    <shape android:shape="rectangle" >
        <solid android:color="#000000" />
    </shape>
</item>
<item
    android:bottom="1dp"
    android:left="1dp"
    android:right="1dp"
    android:top="1dp">
    <shape android:shape="rectangle" >
        <gradient
            android:angle="90"
            android:endColor="#56768d"
            android:startColor="#0a89f1" />
    </shape>
</item>

  </layer-list>                 

<-----listview_selector_pressed----->

   <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item> 
<shape android:shape="rectangle">
  <solid android:color="#000000" /> 
</shape>
   </item>   
<item android:left="1dp" android:right="1dp"  android:top="1dp" android:bottom="1dp"  
    >  
 <shape android:shape="rectangle"> 
 <gradient
  android:startColor="#0a89f1"
     android:endColor="#56768d"
      android:angle="90" />
     </shape>
      </item>    
        </layer-list> 

<-----layoutborder.xml--->

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

<solid android:color="#FFFFFF" />

     <stroke
    android:width="3dip"
    android:color="#B1BCBE" />

       <corners android:radius="10dip" />

      <padding
    android:bottom="0dip"
    android:left="0dip"
    android:right="0dip"
    android:top="0dip" />

      </shape>
4

0 回答 0