我NestedScrollView
一些文字和,因爲這是在 CoordinatorLayout
,當我把它的滾動結束NestedScrollView
的不顯示反彈時的效果,我的猜測是,當我到達終點,並試圖滾動更多我不滾動nestedScrollView,但我滾動CoordinatorLayout
。NestedScrollView在CoordinatorLayout沒有出現反彈時
<android.support.design.widget.CoordinatorLayout
android:id="@+id/activity_news_main_content"
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:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/activity_news_appbar"
android:layout_width="match_parent"
android:layout_height="@dimen/activity_news_background_height"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/activity_news_collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="top"
android:background="@color/activity_news_collapsing_toolbar_background_color"
app:contentScrim="@color/colorPrimary"
app:expandedTitleMarginBottom="@dimen/activity_news_title_margin_bottom"
app:expandedTitleMarginStart="@dimen/activity_news_title_margin_start"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="@+id/activity_news_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"
app:layout_scrollFlags="scroll|exitUntilCollapsed"/>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/activity_news_view_height"
android:layout_gravity="bottom"
android:background="@color/activity_news_collapsing_toolbar_background_color"/>
<include
android:id="@+id/app_bar"
layout="@layout/news_app_bar"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/activity_news_padding">
<TextView
android:id="@+id/activity_news_subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_news_subtitle_bottom_padding"/>
<TextView
android:id="@+id/activity_news_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
的LinearLayout中在NestedScrollView應有的高度設置爲「WRAP_CONTENT」 –
仍然沒有工作... – Markicevic
事實上,一個快速谷歌搜索給了我一個bug提交了這個確切的問題報告。如果你向上或向下飛行,有時可能會看到過度滾動的效果。您可以在這裏查看報告https://code.google.com/p/android/issues/detail?id=175720 –