2015-11-25 3 views
0

Вот моя решетка вида макета, где я пытался использовать android:listSelector="@null"Как удалить границу вокруг сетки ракурса

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="#191919"> 

     <GridView 
      android:id="@+id/gridView" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_margin="5dp" 
      android:columnWidth="100dp" 
      android:drawSelectorOnTop="true" 
      android:gravity="center" 
      android:numColumns="auto_fit" 
      android:stretchMode="columnWidth" 
      android:verticalSpacing="5dp" 
      android:focusable="true" 
      android:clickable="true" 
      android:listSelector="@null"/> 

    </RelativeLayout> 

Но я не могу избавиться от этих черных границ в моей сетке ракурсе

enter image description here

+0

черный цвет является цветом вашего GridView –

+0

но когда я прокрутки вверх или вниз, черная граница перекрывает зеленый макет –

+1

пожалуйста, напишите ваш XML, содержащий GridLayout –

ответ

1

Вы можете изменить его, используя: android: listSelector.

Вы можете попробовать удалить селектор с андроида: listSelector = "@ нулевой

<!-- Setting the listSelector to null removes the 5px border --> 
<GridView 
android:id="@+id/gridview" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:listSelector="@null" /> 

Если он не работает добавить андроида: fadingEdgeLength =" 0px»к вашему GridView

<GridView 
android:id="@+id/gridview" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:fadingEdgeLength="0px" 
android:listSelector="@null" /> 

Or в Java:

GridView.setFadingEdgeLength(0); 
1

Добавить:

android:horizontalSpacing="0dp" 
android:verticalSpacing="0dp" 
Смежные вопросы