2017-09-30 5 views
0

Je veux mettre un bouton à la fin d'un scrollview, je sais que je peux y parvenir si je modifie mon adaptateur, mais je ne veux pas le faire dans de cette façon parce que je pense qu'il y a un moyen plus facile. Donc, j'ai essayé de modifier ma mise en page comme ceci:Mettez un bouton à la fin d'un recyclerview avec swiperefreshlayout

<!-- Not important stuff --> 

<android.support.v4.widget.SwipeRefreshLayout 
     android:id="@+id/refreshIndicatorCoins" 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1"> 
     <android.support.v4.widget.NestedScrollView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 
      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:orientation="vertical"> 
       <android.support.v7.widget.RecyclerView 
        android:id="@+id/rvCoinsFull" 
        android:clickable="true" 
        app:layout_behavior="@string/appbar_scrolling_view_behavior" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content"> 
       </android.support.v7.widget.RecyclerView> 
       <Button 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        /> 
      </LinearLayout> 
     </android.support.v4.widget.NestedScrollView> 
    </android.support.v4.widget.SwipeRefreshLayout> 

Cela fonctionne presque parfait, mais l'animation swipeRefresh gèle

Répondre

0

Hope it helps.

Après RecyclerView, entrez ce code.

<RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_weight="0"> 
     <Button 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      /> 
    </RelativeLayout> 
+0

Il n'a pas wok :( –

+0

quelque chose Post. Qui dire ce que vous voulez –

+0

je ne veux exactement l'animation du swiperefresh pour arrêter –