2016-10-28 6 views
3
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.NestedScrollView 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:keepScreenOn="true" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    tools:context="com.tech.world.MainActivity" 
    tools:showIn="@layout/app_bar_main_activity" 
    android:fillViewport="true" > 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:gravity="center_horizontal" 
     android:paddingBottom="@dimen/activity_vertical_margin" 
     android:paddingLeft="@dimen/activity_horizontal_margin" 
     android:paddingRight="@dimen/activity_horizontal_margin" 
     android:paddingTop="@dimen/activity_vertical_margin" > 

     <TextView 
      android:id="@+id/textView" 
      android:textColor="#43a047" 
      android:typeface="serif" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentTop="true" 
      android:text="@string/app" 
      android:gravity="center" 
      android:textStyle="bold" 
      android:textSize="15sp" /> 


     <android.support.v7.widget.RecyclerView 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      android:id="@+id/recyclerview" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/textView" 
      android:layout_marginTop="10dp" 
      android:divider="@color/colorAccent" 
      android:dividerHeight="1dp" /> 

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

nestedscrollviewアンドロイドにRecyclerView上に現れ、また、私はこれによる拡張し、コーディネータレイアウトの連絡先ツールバーを使用しています、のTextViewを表示するには、下ビットをスクロールする必要があり アプリ:layout_behavior =「@文字列/ appbar_scrolling_view_behavior」がTextViewのdoesnot今以上のTextViewが現れいけない

私はTextViewには、あなたの相対的なレイアウトつまり、あなたのリサイクルビューの親のレイアウトに設定android:focusableInTouchMode="true"

答えて

4

にそれを見るためにビットをスクロールせずに起動時に表示されていることを確認します。

これをチェックするpost

+0

私がbelow_layoutを使用すると、それが起こった理由はありがとうbro。 – AndroidBeginnerJhon

+0

あなたはトップビューをフォーカス可能にする必要があります他の賢明なリサイクラビューはすべてフォーカスを取得します。 –

+0

回答ありがとうございました – AndroidBeginnerJhon

関連する問題