2016-05-17 6 views
1

こんにちは私はリサイクラービューのレイアウトとリサイクラービューの下のフッターを持っています。私のリストに要素がほとんどない場合、フッタが見えていましたが、リサイクラビューでたくさんのデータを展開すると、レイアウト(フッター)が表示されませんでした。リサイクルビューには、その下にデータが隠れています

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    tools:context="bk.tillster.com.activities.CheckOutActivity" 
    tools:showIn="@layout/activity_check_out"> 

    <ImageButton 
     android:id="@+id/add_more_items" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginStart="10dp" 
     android:background="@drawable/box_with_borders" 
     android:paddingBottom="@dimen/credit_card_vertical_margin" 
     android:paddingEnd="@dimen/activity_horizontal_margin" 
     android:paddingStart="@dimen/activity_horizontal_margin" 
     android:paddingTop="@dimen/credit_card_vertical_margin" 
     android:src="@mipmap/add_items_button"/> 

    <android.support.v7.widget.RecyclerView 
     android:id="@+id/order_menu_list_view" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/add_more_items" 
     android:paddingBottom="@dimen/credit_card_vertical_margin" 
     android:scrollbars="vertical"/> 

    <include 
     android:id="@+id/checkout_content" 
     layout="@layout/checkout_footer" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/order_menu_list_view" 
     android:layout_alignParentStart="true"/> 
</RelativeLayout> 

とフッタが

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:paddingBottom="@dimen/credit_card_vertical_margin" 
       android:paddingTop="@dimen/credit_card_vertical_margin"> 

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:orientation="horizontal" 
        android:weightSum="1"> 

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
         android:layout_width="0dp" 
         android:layout_height="wrap_content" 
         android:paddingStart="@dimen/activity_horizontal_margin" 
         android:paddingEnd="@dimen/activity_horizontal_margin" 
         android:layout_gravity="start" 
         android:layout_weight="0.5" 
         android:orientation="horizontal"> 

      <ImageView 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:src="@mipmap/credit_card"/> 

      <TextView 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:gravity="center" 
       android:text="@string/my_card"/> 

     </LinearLayout> 

     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
         android:layout_width="0dp" 
         android:layout_height="wrap_content" 
         android:layout_gravity="end" 
         android:layout_weight="0.3" 
         android:orientation="vertical" 
         android:paddingEnd="@dimen/activity_horizontal_margin" 
         android:paddingStart="@dimen/activity_horizontal_margin"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:gravity="start" 
       android:text="@string/tax_applied" 
       /> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:gravity="start" 
       android:text="@string/total" 
       android:textStyle="bold" 
       /> 
     </LinearLayout> 

     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
         android:layout_width="0dp" 
         android:layout_height="wrap_content" 
         android:layout_gravity="end" 
         android:layout_weight="0.2" 
         android:orientation="vertical" 
         android:paddingEnd="@dimen/activity_horizontal_margin" 
         android:paddingStart="@dimen/activity_horizontal_margin"> 

      <TextView 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:background="@android:color/transparent" 
       android:gravity="end" 
       android:hint="***"/> 


      <TextView 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:background="@android:color/transparent" 
       android:gravity="end" 
       android:hint="***" 
       android:textStyle="bold"/> 
     </LinearLayout> 
    </LinearLayout> 

    <Button 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:background="@color/red" 
     android:text="@string/place_order"/> 
</RelativeLayout> 

以下のように見える私は断片にレイアウトを分割し、動的にそれらを膨らませることができると思うが、私は活動中でそれらをしたいです。また、リサイクラビューがフッターの上に表示される理由を知りたいどのような考えが評価されます。ありがとう。

編集:私はスターバックスのチェックアウトページに似た何かを達成しようとしています。添付のスクリーンショット。 enter image description here

+0

このライン「アンドロイド:layout_below =」@ + ID/order_menu_list_view「」からは、タグを含めて再試行してください。 – Sabari

+0

アンドロイド:layout_height = "wrap_content"の代わりに、フッターの高さを150dpにして、実際に問題を解決しました。 – shreknit

+0

これは素晴らしいです.. – Sabari

答えて

0

あなたのフッターをrecyclerviewでスクロールできますか?ない場合は、以下のあなたのために働く可能性があります

@MinFuコード除く。
<android.support.v7.widget.RecyclerView 
    android:id="@+id/order_menu_list_view" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@+id/add_more_items" 
    android:layout_above="@+id/checkout_content" 
    android:paddingBottom="@dimen/credit_card_vertical_margin" 
    android:scrollbars="vertical"/> 

<include 
    android:id="@+id/checkout_content" 
    layout="@layout/checkout_footer" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentStart="true"/> 
+0

いいえ、私のフッターはスクロール可能で、例外。あなたが私が達成しようとしていることを理解するために質問を編集しました。 – shreknit

+0

@MinFu Includeタグでこの行を削除する必要があります "android:layout_below =" @ + id/order_menu_list_view ""それ以外の場合は循環依存関係例外をスローします – Sabari

+0

私の答えを更新しました@Sabari for correct me – MinFu

関連する問題