Gab*_*tti 35 android android-support-library material-design android-design-library android-coordinatorlayout
我CoordinatorLayout和NestedScrollView(和设计支持库22.2.0)有一个奇怪的问题
使用小于NestedScrollViewI 的内容应该具有固定的内容.然而,尝试向上和向下滚动内容我可以获得内容被取代并且永远不会在他们自己的位置.
这里有一点样本:
这里的代码:
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />
</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">
<FrameLayout
android:paddingTop="24dp"
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/padding">
</FrameLayout>
</android.support.v4.widget.NestedScrollView>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
android:visibility="gone"
android:src="@drawable/ic_done" />
</android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)
Pau*_*rke 37
当删除细节片段中除一张卡以外的所有卡片时,也可以在cheesesquare演示中观察到这一点.
我能够使用这个类解决这个问题(现在):https://gist.github.com/EmmanuelVinas/c598292f43713c75d18e
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="com.evs.demo.layout.FixedScrollingViewBehavior">
.....
</android.support.v4.widget.NestedScrollView>
Run Code Online (Sandbox Code Playgroud)
小智 37
我认为这不是支持库中的错误,只需使用它
<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:fillViewport="true"
android:layout_gravity="fill_vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
59566 次 |
| 最近记录: |