Android appcompt库23.1.1:折叠工具栏布局在滚动时不折叠
如果我使用“com.android.support:design:23.0.1”这个代码工作得非常好,但是如果我用新版本更新gradel,“com.android.support:design:23.1.1”就像一切都冻结了一样Android appcompt库23.1.1:折叠工具栏布局在滚动时不折叠,android,android-support-library,android-support-design,android-collapsingtoolbarlayout,Android,Android Support Library,Android Support Design,Android Collapsingtoolbarlayout,如果我使用“com.android.support:design:23.0.1”这个代码工作得非常好,但是如果我用新版本更新gradel,“com.android.support:design:23.1.1”就像一切都冻结了一样 <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.
<?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"
android:id="@+id/root_coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed">
<ImageView
android:layout_width="match_parent"
android:layout_height="192dp"
android:scaleType="centerCrop"
android:src="@drawable/header"
app:layout_collapseMode="parallax" />
<LinearLayout
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_collapseMode="parallax"
android:orientation="vertical">
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_marginTop="15dp"
android:padding="10dp"
tools:text="Your Name"
android:textColor="@android:color/white"
android:textSize="24sp"
/>
<TextView
android:id="@+id/period"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:padding="10dp"
tools:text="Period"
android:textColor="@android:color/white"
android:textSize="18sp"
/>
<TextView
android:id="@+id/year"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
tools:text="2015"
android:textColor="@android:color/white"
android:textSize="18sp"
/>
</LinearLayout>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
</android.support.design.widget.CoordinatorLayout>
问题
- 我不能崩溃
- 我无法滚动回收视图
app:layout_scrollFlags="scroll|exitUntilCollapsed"
在折叠工具栏布局中使用此选项,并查看其是否工作。将所有支持库(如appcompat)更新为同一版本。