CoordinatorLayoutとAppBarLayoutを使用するとさらに問題が発生します。CoordinatorLayout/AppBarLayout ExpandableListViewが画面外にレンダリングされる
スクロールして画面をスクロールして画面上に戻るときに、ツールバーのスクロールが画面外にスクロールされるという基本的な機能を実現しようとしています。
私の現在の設定は問題を示しています:ツールバーがスクロールしていないだけでなく、リストビューが画面の下部に表示されているようです。 AppBarLayoutの高さによってオフセットされているかのようです。ここで
は、問題を記述したGIFで、スクロールバーがオフになっても、最後の項目が遮断されていることに注意してください画面:
私のレイアウトはかなり標準です:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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:background="@color/background">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:background="@color/orange"
app:layout_scrollFlags="scroll|enterAlways"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipeToRefresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<ExpandableListView
android:id="@+id/listView"
android:groupIndicator="@android:color/transparent"
android:layout_width="match_parent"
android:dividerHeight="0px"
android:layout_height="match_parent"/>
</android.support.v4.widget.SwipeRefreshLayout>
</android.support.design.widget.CoordinatorLayout>
をそれはあなたがより良い「RecyclerViewを言うべき – waleedsarwar86