对于网络中的图像加载到图像视图中后,工具栏标题不断消失感到很沮丧。我尝试遵循所有关于stackoverflow的建议,但没有一个起作用。
当我使用设计v23.0.4时,此问题并未持续。
我正在使用Glide库将图像加载到ID为networkImageView的ImageView中。
删除所有android:fitsSystemWindows =“ true”属性后,这是我的XML代码段。即使删除此属性,问题仍然存在。
<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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".movies.moviedetails.MovieDetailsActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="@+id/networkImageView"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@android:color/white"
android:scaleType="centerCrop"
android:src="@drawable/backdrop_def_image"
app:layout_collapseMode="parallax" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
请帮我解决这个问题。为什么Google会不断向最新的设计库中引入错误?他们修复一个版本中的错误,并在另一版本中添加相同的错误。
最佳答案
尝试将support Library version
从24.2.1
更改为24.1.1
,以在CollapsingToolbarLayout中显示标题。
因为在最新版本的24.2.1
中,它是错误的,无法修复。因此,对于变通办法,您必须降低我建议的supprort库的版本。