android– 状态栏在工具栏上方为白色[复制]

android– 状态栏在工具栏上方为白色[复制],第1张

概述参见英文答案>Howtochangethestatusbarcolorinandroid                                    14个我正在做一个应用程序,状态栏现在是白色的.我没有对布局做任何想象.如何让状态栏显示为“正常”(白色图标会显示为黑色)..这是我的

参见英文答案 > How to change the status bar color in android                                    14个
我正在做一个应用程序,状态栏现在是白色的.我没有对布局做任何想象.如何让状态栏显示为“正常”(白色图标会显示为黑色).

.

这是我的布局:

 <?xml version="1.0" enCoding="utf-8"?> <linearLayout   androID:ID="@+ID/container_toolbar"   androID:layout_wIDth="match_parent"   androID:layout_height="wrap_content"   androID:orIEntation="vertical"   xmlns:androID="http://schemas.androID.com/apk/res/androID"><include    androID:ID="@+ID/toolbar"    layout="@layout/toolbar" /> <include layout="@layout/content_movIE_detail" /></linearLayout>

工具栏:

<?xml version="1.0" enCoding="utf-8"?><androID.support.v7.Widget.Toolbar   xmlns:androID="http://schemas.androID.com/apk/res/androID"  xmlns:local="http://schemas.androID.com/apk/res-auto"  androID:ID="@+ID/toolbar"  androID:layout_wIDth="match_parent"  androID:layout_height="wrap_content"  androID:minHeight="?attr/actionbarSize"  androID:background="@color/colorPrimary"  local:theme="@style/themeOverlay.AppCompat.Dark.Actionbar"  local:popuptheme="@style/themeOverlay.AppCompat.light" />

活动:

@OverrIDeprotected voID onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentVIEw(R.layout.activity_movIE_detail);    Toolbar toolbar = (Toolbar) findVIEwByID(R.ID.toolbar);    setSupportActionbar(toolbar);    actionbar = getSupportActionbar();    try {        assert actionbar != null;        actionbar.setdisplayHomeAsUpEnabled(true);        actionbar.setHomebuttonEnabled(true);        actionbar.setdisplayShowTitleEnabled(true);    } catch (Exception ignored) {        Log.e(TAG,ignored.toString());    }}

我错过了什么?

解决方法:

我在这里找到了答案:

Status bar is white

<item name="androID:statusbarcolor">@androID:color/transparent</item>

您将在values / styles / styles.xml(v21)中看到该行代码.删除它,这解决了问题

总结

以上是内存溢出为你收集整理的android – 状态栏在工具栏上方为白色[复制]全部内容,希望文章能够帮你解决android – 状态栏在工具栏上方为白色[复制]所遇到的程序开发问题。

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

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

原文地址: http://outofmemory.cn/web/1116229.html

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

发表评论

登录后才能评论

评论列表(0条)

保存