2016-06-21 14 views
1

Ich habe eine recyclerview in meinem Layout. Mein Problem ist zusätzlicher Platz in recyclerview. Wie kann ich es entfernen? hier ist mein Code:
Recycler Artikel:
Artikel ohne zusätzlichen Platz

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" android:layout_width="wrap_content" 
android:layout_height="match_parent"> 

<ImageView 
    android:id="@+id/imgGalleryImage" 
    android:layout_height="match_parent" 
    android:layout_width="wrap_content" 
    android:layout_margin="10dp" 
    android:src="@drawable/slider1" 
    xmlns:android="http://schemas.android.com/apk/res/android" /> 

recuclerview:

<android.support.v7.widget.RecyclerView 
    android:id="@+id/photographerImageGalleryRecycler" 
    android:layout_width="match_parent" 
    android:layout_height="200dp" 
    android:scrollbars="horizontal" 
    android:layout_centerInParent="true" 
    android:layout_marginTop="10dp" 
    android:layout_marginBottom="10dp" 
    android:visibility="visible" 
    android:choiceMode="singleChoice" /> 

und der Code:

 List<BundlePhotographerImageGallery> photographerImageGalleryList = new ArrayList<>(); 

    for (int i = 0; i < 20; i++) { 
     BundlePhotographerImageGallery bundlePhotographerImageGallery = new BundlePhotographerImageGallery(); 
     bundlePhotographerImageGallery.image = "slider1"; 
     photographerImageGalleryList.add(bundlePhotographerImageGallery); 
    } 

    AdapterPhotographerImageGalleryRecycler adapterPhotographerImageGalleryRecycler = new AdapterPhotographerImageGalleryRecycler(photographerImageGalleryList, getApplicationContext()); 
    photographerImageGalleryRecycler.setLayoutManager(linearLayoutManager1); 
    photographerImageGalleryRecycler.setAdapter(adapterPhotographerImageGalleryRecycler); 

und Bild: enter image description here

+1

android: layout_width = "match_parent" ersetzen diese mit Android: layout_width = "wrap_content" in RecycleView und auch Marge von Image entfernen – Vickyexpert

Antwort

1

entfernen Margen aus Recycler Sicht und Imageview

Verwandte Themen