2017-04-12 13 views
1

コーディネーター内のappbarlayoutに接続されたcardviewの中にあるrecyclerviewを作成する必要があります。RecyclerViewのパディングがネストされたスクロールビューで機能しない

私はカードビューにパディングを添付することができません、次のheirachyセットアップ

Coordinator 
    AppBar 
    NestedScrollView 
    CardView 
     Recycler 

を持っています。上マージンは機能しません。

コード

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

    <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:app="http://schemas.android.com/apk/res-auto" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_marginTop="10dp" 
     app:cardCornerRadius="4dp" 
     app:cardElevation="@dimen/elevation_small"> 

     <android.support.v7.widget.RecyclerView 
      android:id="@+id/establishments_rv" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"></android.support.v7.widget.RecyclerView> 
    </android.support.v7.widget.CardView> 

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

cardviewでmargintopパラメータが影響を与えるものではありません。

任意のポインタ?

答えて

0

を増やしてみてくださいアンドロイド:paddingTop = "10dp" NestedScrollView

関連する問題