我试图collapsingToolbarLayout
仅在折叠时设置标题
为此我设置:
app:expandedTitleTextAppearance="@android:color/transparent"
它运作良好。
但是在 4.2.2 应用程序崩溃并出现以下日志
STACK_TRACE
java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:687)
at android.graphics.Bitmap.createBitmap(Bitmap.java:666)
at android.graphics.Bitmap.createBitmap(Bitmap.java:633)
at android.support.design.widget.CollapsingTextHelper.ensureExpandedTexture(CollapsingTextHelper.java:405)
at android.support.design.widget.CollapsingTextHelper.setInterpolatedTextSize(CollapsingTextHelper.java:382)
at android.support.design.widget.CollapsingTextHelper.calculateOffsets(CollapsingTextHelper.java:227)
at android.support.design.widget.CollapsingTextHelper.setExpansionFraction(CollapsingTextHelper.java:203)
at android.support.design.widget.CollapsingToolbarLayout$OffsetUpdateListener.onOffsetChanged(CollapsingToolbarLayout.java:754)
at android.support.design.widget.AppBarLayout$Behavior.dispatchOffsetUpdates(AppBarLayout.java:851)
at android.support.design.widget.AppBarLayout$Behavior.setAppBarTopBottomOffset(AppBarLayout.java:834)
at android.support.design.widget.AppBarLayout$Behavior.scroll(AppBarLayout.java:793)
at android.support.design.widget.AppBarLayout$Behavior.onNestedScroll(AppBarLayout.java:644)
at android.support.design.widget.AppBarLayout$Behavior.onNestedScroll(AppBarLayout.java:583)
at android.support.design.widget.CoordinatorLayout.onNestedScroll(CoordinatorLayout.java:1428)
at android.support.v4.view.eh.a(ViewParentCompat.java:97)
at android.support.v4.view.ec.a(ViewParentCompat.java:330)
at android.support.v4.view.bk.a(NestedScrollingChildHelper.java:162)
at android.support.v7.widget.RecyclerView.dispatchNestedScroll(RecyclerView.java:8306)
at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1387)
at android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:2209)
请建议我正确的实现方法。
或者
是否有任何Listener
检测是否collapsingToolbarLayout
折叠以便我可以隐藏/取消隐藏ToolBar
标题...
或者
是否可以将collapsingToolbarLayout
标题设置为与我想要的另一个视图对齐...