我想在我的应用程序中使用与 @chrisbanses cheesesquare ( https://github.com/chrisbanes/cheesesquare ) 类似的布局。
在 Nexus 5,6 上一切正常。但是当您在三星 S6、Sony Z3 Compact 等其他设备上对其进行测试时,工具栏中的按钮是不可见的。
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="@dimen/detail_backdrop_height"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="@+id/backdrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
android:src="@drawable/default_vehicle"
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>
这是我的布局。我找不到解决此问题的方法。您可以尝试在带有 5.0.2 Android 的三星 S 等手机上运行 Cheesesquare。我还测试了索尼设备。相同。Nexus 手机没问题。
你知道如何解决这个问题吗?
我正在使用 com.android.support:design:22.2.0 (最新版本)