2016-03-15 60 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给了滚动视图作为下面的布局,所以我用这样的。 –