0

画像をスライドして表示するために、上部にビューページャーがあります。残りの画像やリストに表示したいものを表示した後に、このリストの下にRelativeLayoutがあります。RecycleViewは以下のRelatvieLayoutを追加することでスクロールしません。

問題: - 私はRecycleViewの問題に直面しています。 RelativeLayoutをparentofbottomに追加し、RecycleViewプロパティをRelativeLayoutよりも上に設定するまではうまくいきました。今問題はRecycleViewがスクロールしていないことです。コードに何が間違っていますか?何.ORを変更する必要が私に他の任意の方法を提案することandroid:layout_below="@id/relativeLayout1"に、このデザインに

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/drawer_layout" 
    xmlns:ads="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    > 

    <RelativeLayout 
     android:id="@+id/container" 
     android:layout_width="match_parent" 
     android:focusableInTouchMode="true" 
     android:layout_height="match_parent" > 

     <RelativeLayout 
      android:id="@+id/relativeHeader" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentTop="true" 
      android:background="@color/headecolor" > 

      <Button 
       android:id="@+id/btnOpenDrawer" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentLeft="true" 
       android:layout_centerVertical="true" 
       android:background="@drawable/menu_icon" /> 

      <Button 
       android:id="@+id/button1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentRight="true" 
       android:layout_centerVertical="true" 
       android:background="@drawable/alert_icon" /> 

      <TextView 
       android:id="@+id/txtTitle" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerHorizontal="true" 
       android:layout_centerVertical="true" 
       android:textStyle="bold" 
       android:text="A La Une" 
       android:textAppearance="?android:attr/textAppearanceMedium" 
       android:textColor="@color/blackColor" /> 
     </RelativeLayout> 

     <android.support.v4.widget.NestedScrollView 
     android:id="@+id/scroler" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_below="@+id/relativeHeader" 
     android:fillViewport="true" 
     android:background="@android:color/white" > 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:focusableInTouchMode="true" 
      android:background="@android:color/white" > 

      <RelativeLayout 
       android:id="@+id/relativeLayout1" 
       android:layout_width="wrap_content" 
       android:descendantFocusability="blocksDescendants" 
       android:layout_height="wrap_content" > 

       <RelativeLayout 
        android:id="@+id/rlPager" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" > 

        <egdigital.alpes1.view.WrapContentViewPager 
         android:id="@+id/view_pager" 
         android:layout_width="match_parent" 
         android:layout_height="220dp" 
         android:adjustViewBounds="true" 
         android:background="@drawable/news_img_transparent" 
         /> 

        <ImageView 
         android:id="@+id/imageView_dot" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:layout_alignBottom="@+id/view_pager" 
         android:layout_alignParentLeft="true" 
         android:src="@drawable/scroll_dot1" /> 

       </RelativeLayout> 

      </RelativeLayout> 

      <RelativeLayout 
       android:id="@+id/rlRecycle" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_below="@+id/relativeLayout1" 
       android:layout_above="@+id/rlMiniPlayer" 
       > 

      <android.support.v7.widget.RecyclerView 
       android:id="@+id/recyclerview" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:clipToPadding="false" 
       android:paddingBottom="80dp"> 
      </android.support.v7.widget.RecyclerView> 
       </RelativeLayout> 
      <RelativeLayout 
       android:id="@+id/rlMiniPlayer" 
       android:layout_width="match_parent" 
       android:layout_height="80dp" 
       android:layout_alignParentBottom="true" 
       > 
      </RelativeLayout> 

     </RelativeLayout> 
    </android.support.v4.widget.NestedScrollView> 
    </RelativeLayout> 

    <fragment 
     android:id="@+id/navigation_drawer" 
     android:name=".NavigationDrawerFragment" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" 
     android:layout_marginLeft="25dp" 
     tools:layout="@layout/fragment_navigation_drawer" /> 

</android.support.v4.widget.DrawerLayout> 
+0

試してください: 'アンドロイド:あなたのrecyclerViewに'スクロールバー= "縦" – Marat

+0

をu recyclerviewのレイアウトマネージャのセットアップ持っている - :?これは、このような問題

を作成していますか –

+0

はい私はセットアップがあります。手動で高さを測定しようとしましたが、それも機能しませんでした。 –

答えて

0

1)変更

android:layout_below="@+id/relativeLayout1" を達成し、どこか他のあなたがlayout_belowまたはlayout_above

+をするときに使用されている変更します新しいidを作成します。既に作成済みのidを使用する場合は、+

2)id:rlRecycleの実際にはRelativeLayoutは必要ありません。 layout_belowlayout_aboveの属性はRecyclerViewに直接移動することができます。これは既にトップレベルRelativeLayout

+0

説明のために感謝します。 私はif(list.size()== 20){txt.setVisibility(View.Visible)}のようなものを使用するとアダプタの問題に直面していることを知っています。 Recycleviewは余分なスペースをたくさん追加します。私は何が間違っているのかわかりません。私は手動でrecycleviewアイテムの高さを計算しています。 @sharj –

0

I Found The Solutionの下にあるためです。私は余分なRelativeLayoutsがたくさんあることを知っています。私はそれを削除知っています。入れ子になったスクロールビューの下にrlMiniPlayerを置いた 私はnestedscrolling = trueを使用しているためです。コードでこれを追加

</android.support.v4.widget.NestedScrollView> 
     <RelativeLayout 
      android:id="@+id/rlMiniPlayer" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" 
      > 
     </RelativeLayout> 
関連する問題