2016-11-24 6 views
0

私はRecyclerViewとLinearLayoutを下記のような私の引用アプリケーションで使用しています。RecyclerView LinearLayoutを隠す

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
 
    xmlns:tools="http://schemas.android.com/tools" 
 
    android:layout_width="match_parent" 
 
    android:layout_height="match_parent" 
 
    > 
 

 

 
    <LinearLayout 
 
     android:background="@color/colorPrimary" 
 
     android:layout_alignParentBottom="true" 
 
     android:id="@+id/pageNavLayout" 
 
     android:orientation="horizontal" 
 
     android:layout_width="match_parent" 
 
     android:layout_height="40dp"> 
 

 

 
     <RelativeLayout 
 
      android:layout_weight="1" 
 
      android:id="@+id/butPrev" 
 
      style="@style/SelectableItemBackground" 
 
      android:clickable="true" 
 
      android:layout_width="0dp" 
 
      android:layout_height="match_parent"> 
 

 
      <ImageView 
 
       android:layout_centerInParent="true" 
 
       android:scaleType="fitCenter" 
 
       android:src="@drawable/ic_keyboard_arrow_left_white_24dp" 
 
       android:layout_width="match_parent" 
 
       android:layout_height="match_parent" /> 
 
     </RelativeLayout> 
 

 

 
     <View 
 
      android:background="#ffffff" 
 
      android:layout_width="1dp" 
 
      android:layout_height="match_parent"/> 
 

 
     <TextView 
 
      android:id="@+id/textPageCount" 
 
      android:clickable="true" 
 
      style="@style/SelectableItemBackground" 
 
      android:padding="8dp" 
 
      android:textSize="16sp" 
 
      android:textColor="@android:color/white" 
 
      android:text="Page 1 0f 67" 
 
      android:layout_width="wrap_content" 
 
      android:layout_height="wrap_content" /> 
 

 
     <View 
 
      android:background="#ffffff" 
 
      android:layout_width="1dp" 
 
      android:layout_height="match_parent"/> 
 

 
     <RelativeLayout 
 
      android:layout_weight="1" 
 
      style="@style/SelectableItemBackground" 
 
      android:clickable="true" 
 
      android:id="@+id/butNext" 
 
      android:layout_width="0dp" 
 
      android:layout_height="match_parent"> 
 

 
      <ImageView 
 
       android:layout_centerInParent="true" 
 
       android:src="@drawable/ic_keyboard_arrow_right_white_24dp" 
 
       android:layout_width="match_parent" 
 
       android:layout_height="match_parent" /> 
 
     </RelativeLayout> 
 

 
    </LinearLayout> 
 

 
    <android.support.v7.widget.RecyclerView 
 
     android:layout_marginTop="4dp" 
 
     android:layout_marginBottom="4dp" 
 
     android:layout_above="@id/pageNavLayout" 
 
     android:id="@+id/listQuoteView" 
 
     android:layout_width="match_parent" 
 
     android:layout_height="match_parent"></android.support.v7.widget.RecyclerView> 
 

 
</RelativeLayout>

今、私は次のボタンとRecyclerViewリストを押し、別の引用...私はそれをスクロールするときには、そのがそれを示す、いくつかの時間のために私のLinearLayoutを隠します。私は私のボトムバーにLinearLayoutを使用しました。私が欠けているものと、私はいつもボトムバーを表示するために何をすべきですか?

ありがとうございました

+0

あなたが使っているコードは何ですか? XMLは、隠れ要素やサイズ変更の有無など、多くのことを教えてくれません。 –

答えて

0

あなたLinearLayout高さは(あなたのコードを1として)40dpであるとして、それは目に見えるすべての時間を作るためにあなたのRecyclerViewandroid:layout_marginBottom="40dp"を追加します。

0

これを試してください。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    > 

    <android.support.v7.widget.RecyclerView 
     android:layout_marginTop="4dp" 
     android:layout_marginBottom="4dp" 
     android:id="@+id/listQuoteView" 
     android:layout_width="match_parent" 
     android:weight="1" 
     android:layout_height="0dp"> 
    </android.support.v7.widget.RecyclerView> 

<LinearLayout 
    android:orientation="vertical" 
    android:id="@+id/pageNavLayout" 
    android:layout_width="match_parent" 
    android:weight="1" 
    android:layout_height="0dp"> 

    <LinearLayout 
     android:background="@color/colorPrimary" 
     android:orientation="horizontal" 
     android:layout_width="match_parent" 
     android:layout_height="40dp"> 


     <RelativeLayout 
      android:layout_weight="1" 
      android:id="@+id/butPrev" 
      style="@style/SelectableItemBackground" 
      android:clickable="true" 
      android:layout_width="0dp" 
      android:layout_height="match_parent"> 

      <ImageView 
       android:layout_centerInParent="true" 
       android:scaleType="fitCenter" 
       android:src="@drawable/ic_keyboard_arrow_left_white_24dp" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" /> 
     </RelativeLayout> 


     <View 
      android:background="#ffffff" 
      android:layout_width="1dp" 
      android:layout_height="match_parent"/> 

     <TextView 
      android:id="@+id/textPageCount" 
      android:clickable="true" 
      style="@style/SelectableItemBackground" 
      android:padding="8dp" 
      android:textSize="16sp" 
      android:textColor="@android:color/white" 
      android:text="Page 1 0f 67" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 

     <View 
      android:background="#ffffff" 
      android:layout_width="1dp" 
      android:layout_height="match_parent"/> 

     <RelativeLayout 
      android:layout_weight="1" 
      style="@style/SelectableItemBackground" 
      android:clickable="true" 
      android:id="@+id/butNext" 
      android:layout_width="0dp" 
      android:layout_height="match_parent"> 

      <ImageView 
       android:layout_centerInParent="true" 
       android:src="@drawable/ic_keyboard_arrow_right_white_24dp" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" /> 
     </RelativeLayout> 

    </LinearLayout> 

</LinearLayout> 
</LinearLayout> 
0

はここで、画面の一番下に固定のだ要素の例です:あなたが使用していることを確認する必要があり

<RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:gravity="center" 
     android:background="#26ffffff" 
     android:paddingTop="3dp" 
     android:paddingBottom="3dp"> 
     <TextView 
      android:id="@+id/today_last_sync" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:textSize="12sp" 
      android:gravity="right" 
      android:textColor="@color/white"/> 
    </RelativeLayout> 

子XMLに設定し、次の

android:layout_alignParentBottom="true" 

親容器と同様に:

android:layout_width="match_parent" 
    android:layout_height="match_parent" 
関連する問題