0

J'utilise gridview en quinconce qui est placé à l'intérieur de NestedScrollview. Je ne sais pas si cela arrive l'un en dessous de l'autre lors du chargement pour la première fois (si le cache de l'image n'est pas là). Y a-t-il un problème avec gridview échelonné? Ou est-ce à cause de ma mise en page, ça arrive comme ça. Quelqu'un s'il vous plaît aidez.Le quadrillage échelonné ne fonctionne pas correctement dans android

Images are coming like one below the other sometimes.

Ma mise en page XML est la suivante

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/main_content" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true"> 

    <android.support.design.widget.AppBarLayout 
     android:id="@+id/appbar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:fitsSystemWindows="true" 
     android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
     app:expandedTitleTextAppearance="@android:color/transparent"> 

     <android.support.design.widget.CollapsingToolbarLayout 
      android:id="@+id/collapsing_toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      app:layout_scrollFlags="scroll|exitUntilCollapsed" 
      android:fitsSystemWindows="true" 
      app:contentScrim="?attr/colorPrimary" 
      app:expandedTitleMarginStart="48dp" 
      app:expandedTitleMarginEnd="64dp" 
      app:expandedTitleTextAppearance="@android:color/transparent"> 

      <ImageView 
       android:id="@+id/backdrop" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:scaleType="fitCenter" 
       android:maxHeight="@dimen/detail_backdrop_maxheight" 
       android:adjustViewBounds="true" 
       app:layout_collapseMode="parallax" 
       android:contentDescription="Top Image"/> 

      <android.support.v7.widget.Toolbar 
       android:id="@+id/toolbar" 
       android:layout_width="match_parent" 
       android:layout_height="?attr/actionBarSize" 
       app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
       app:layout_collapseMode="pin" 
       app:expandedTitleTextAppearance="@android:color/transparent"/> 

     </android.support.design.widget.CollapsingToolbarLayout> 

    </android.support.design.widget.AppBarLayout> 

    <android.support.v4.widget.NestedScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" > 

      <com.hit.pretstreet.pretstreet.core.customview.TextViewPret 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:background="@color/yellow" 
      style="@style/textview_normal" 
      android:id="@+id/tv_heading_photos" 
      app:pret_typeface="@string/font_redvelvet_regular"/> 

     <android.support.v7.widget.RecyclerView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:id="@+id/rv_images" 
      android:layout_marginLeft="-2dp" 
      android:layout_marginRight="-2dp" 
      android:nestedScrollingEnabled="false"/> 

     </LinearLayout> 

    </android.support.v4.widget.NestedScrollView> 
</android.support.design.widget.CoordinatorLayout> 

Note: Je suis le chargement des images du serveur.

Cordialement

+1

pourrait vous s'il vous plaît un peu de code - où vous utilisez le gridview & LayoutManager, etc – chornge

+0

J'ai mis à jour ma question. Jetez un coup d'oeil s'il vous plait. –

Répondre

0

Enfin, j'ai eu la réponse. C'est parce que j'ai manqué des espaces réservés lors du chargement des images.