Вот GridView: [test_grid.xml]Не удается удалить обивка ImageView в GridView
<RelativeLayout xmlns:android="http:....."
android:layout_height="match_parent"
android:layout_width="match_parent">
<GridView
android:id="@+id/grid_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:numColumns="6"
android:verticalSpacing="0dp"
android:horizontalSpacing="0dp"
android:stretchMode="columnWidth"
android:gravity="center"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="5dp"
>
</GridView>
</RelativeLayout>
и ImageView: image_item.xml
<RelativeLayout xmlns:android="http:....."
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="45dp"
android:layout_height="45dp"
android:id="@+id/imageLetter"
android:padding="0dp" />
</RelativeLayout>
И в GridAdapter.java
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater)
mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if(convertView==null){
convertView=inflater.inflate(R.layout.item_list,parent,false);
}
ImageView imageView=(ImageView)convertView.findViewById(R.id.imageLetter);
imageView.setImageResource(mThumbIds[position]);
return imageView;
Проблема: не удалось удалить прокладку вокруг изображения, enter image description here Я попытался это:
imageView.setPadding(0,0,0,0);
, но никаких результатов. Цените любую помощь, совет.
http://stackoverflow.com/questions/7705330/gridview-and-excess-space-padding/9106404#9106404 – Sanjeev
http://stackoverflow.com/questions/9125014/how-to-remove-the-space -between-rows-of-grid-view-in-android/9142456 # 9142456 – Sanjeev
Попробуйте использовать 'android: adjustViewBounds =" true "' в вашем ImageView –