ViewPagerでCoordinatorLayoutで構成されたビューを実装しようとしています.NestedScroolViewは各ViewPagerの内部にあります。水平スクロールを処理するためにViewPager内のNestedScrollViewを停止します
ビューページャのコンテンツを変更するために左右にスワイプすると、ジェスチャがNestedScrollViewに転送されて、時々、次のような問題が発生することがありました。非常に小さい垂直スクロール。それは小さいですが、迷惑になるほどです。
これは、より良い問題を説明する必要があります
ビデオ:https://youtu.be/BGqynDDL68I
私はスクロール/情事の方法をブロックするようにNestedScrollViewを拡張しようとしたんが、何も成功しました。
誰もが同じ問題を抱えていますか?
EDIT 1:コード
活動:
<?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"
xmlns:tools="http://schemas.android.com/tools"
tools:context="main.MainActivity"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--<include layout="@layout/main__activitycontent"/>-->
<android.support.design.widget.AppBarLayout
android:id="@+id/id_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/main__toolbar"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/main__fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
<android.support.design.widget.TabLayout
android:id="@+id/main__navigations_tablayout"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_gravity="bottom"
android:background="@color/main__tabbar_button_color"
app:layout_behavior="utils.views.TabLayoutBehaviour"
app:tabIndicatorColor="@android:color/white"
app:tabSelectedTextColor="@color/main__tabbar_selected_color"
app:tabTextColor="@color/main__tabbar_normal_color"
>
</android.support.design.widget.TabLayout>
</android.support.design.widget.CoordinatorLayout>
断片とViewPager
<android.support.v4.view.ViewPager
android:id="@+id/meditationpager__pager"
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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
インナーフラグメント:
<android.support.v4.widget.NestedScrollView
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:background="@android:color/white"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="main.MainActivity"
tools:showIn="@layout/main__activity">
<LinearLayout
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="wrap_content"
android:orientation="vertical"
tools:context="domain.screens.readmeditation.MeditationFragment">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/large_text"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
ちょうどメモ:下部のバーは、ViewPagerにリルートされていない、ナビゲーションバーです。 –
私が見ることができるもののために、下のバーには "下に目を向ける"があります。私は正しい? – royB
ええと、ツールバーも少し上に行く(下のバーの動作はツールバーに依存しないので、ツールバーが動いたときに下のバーが反対方向に動く) –