android – 在Nougat上运行时,为什么在使用CollapsingToolbarLayout时标题会被切断?

android – 在Nougat上运行时,为什么在使用CollapsingToolbarLayout时标题会被切断?,第1张

概述我正在使用以下布局,它适用于除 Android Nougat之外的所有版本,完全折叠时标题会被切断. <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/collapsing_toolbar" android:layout_width="match_paren 我正在使用以下布局,它适用于除 Android Nougat之外的所有版本,完全折叠时标题会被切断.

<androID.support.design.Widget.CollapsingToolbarLayout            androID:ID="@+ID/collapsing_toolbar"            androID:layout_wIDth="match_parent"            androID:layout_height="300dp"            androID:fitsSystemwindows="true"            app:contentScrim="@color/them_color"            app:expandedTitleTextAppearance="@androID:color/transparent"            app:layout_scrollFlags="scroll|exitUntilCollapsed">            <ImageVIEw                androID:ID="@+ID/header_image"                androID:layout_wIDth="match_parent"                androID:layout_height="300dp"                androID:contentDescription="@string/app_name"                androID:fitsSystemwindows="true"                androID:scaleType="fitXY"                app:layout_collapseMode="parallax"/>            <androID.support.v7.Widget.Toolbar                androID:ID="@+ID/toolbar"                androID:layout_wIDth="match_parent"                androID:layout_height="?androID:attr/actionbarSize"                app:layout_collapseMode="pin"                app:contentInsetleft="0dp"                app:popuptheme="@style/themeOverlay.AppCompat.light"/>        </androID.support.design.Widget.CollapsingToolbarLayout>

我试过app:collapsedTitleGravity =“center”但它没有解决问题.我怎样才能让它在牛轧糖上起作用?

解决方法 问题是 reported.

除了fitsSystemwindows之外,还有更好的选择,只需添加到onCreate collapsingToolbarLayout.post {collapsingToolbarLayout.requestLayout()}

总结

以上是内存溢出为你收集整理的android – 在Nougat上运行时,为什么在使用CollapsingToolbarLayout时标题会被切断?全部内容,希望文章能够帮你解决android – 在Nougat上运行时,为什么在使用CollapsingToolbarLayout时标题会被切断?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1134480.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存