2016-03-15 63 views
0

下,我想提出一個佈局像下面RecyclerGridView滾動型

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

     <LinearLayout 
      android:id="@+id/l_out 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

       <-Some view here.....-> 
     </LinearLayout> 
     <android.support.v7.widget.RecyclerView 
      android:id="@+id/similar_recyclerview" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"/> 
</LinearLayout> 

現在的問題是我不知道的l_out高度。當l_out的高度更多時,RecyclerView變爲隱藏並且l_out的某個部分變爲隱藏並且RecyclerViewScrollView中不起作用。我怎樣才能實現我的上述佈局做垂直滾動?

回答

0

希望這將幫助你

<ScrollView 
    android:fillViewport="true" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_below="@+id/id_scroll"> 
      <android.support.v7.widget.RecyclerView 
      android:id="@+id/similar_recyclerview" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      /> 
</ScrollView> 
+0

是什麼?「機器人:layout_below =「@ + ID/id_scroll」 –

+0

你有沒有達到你的目標 –

+0

我放在下一個佈局的滾動視圖,以便爲什麼我會m給了滾動視圖作爲下面的佈局,所以我用這樣的。 –