内部で CoordinatorLayout と ViewPager を使用しています。問題は、リストの最初のエントリ (ViewPager の最初のページ) がタブによって隠されていることです。CoordinatorLayout の代わりに LinearLayout を使用すると、すべて正常に動作します。
- その重複を修正する方法は?
- FloatingButton をここに追加する必要がありますか、それとも ListView XML に追加する必要がありますか?
XML は次のとおりです。
<?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.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.TabLayout
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager_list_views"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v4.view.ViewPager>
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_margin="16dp"
android:src="@android:drawable/ic_menu_add"
app:layout_anchor="@id/pager_list_views"
app:layout_anchorGravity="bottom|right|end" />
</android.support.design.widget.CoordinatorLayout>