Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Android:工具栏状态栏重叠大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在创建一个带有半透明状态栏的棒棒糖工具栏的应用程序,以使状态栏也着色.它的工作正常
真实财产.

只是工具栏现在与状态栏重叠,看起来很乱.将工具栏放在状态栏下方并保持窗口半透明状态的选项有哪些?

代码片段:

<style name="Theme.XXX" parent="Theme.AppCompat">
      <item name="colorPriMary">...</item>
      <item name="colorPriMaryDark">...</item>
      <item name="android:windowTranslucentStatus">true</item>
      <item name="windowActionBar">false</item>
      <item name="colOraccent">...</item>
   </style>

活动中使用的工具栏代码

<android.support.v7.widget.Toolbar
        android:id="@+id/main_toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:BACkground="@color/XXX"
        android:elevation="5dp"
        android:minHeight="?attr/actionBarSize"
        android:theme="@style/Theme.XXX" />

提前致谢.

解决方法

正如病毒正确地说的那样,答案就在这里Toolbar overlapping below status bar

只需添加属性即可

进入xml项目,它会工作正常:)

大佬总结

以上是大佬教程为你收集整理的Android:工具栏状态栏重叠全部内容,希望文章能够帮你解决Android:工具栏状态栏重叠所遇到的程序开发问题。

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

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。