gpt4 book ai didi

java - 如何在android状态栏上写

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:46:16 25 4
gpt4 key购买 nike

我正在尝试在onCreate()方法中执行类似的操作。

enter image description here

@TargetApi(21)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getWindow().getDecorView().setBackgroundColor(Color.parseColor("#444444"));
getWindow().setStatusBarColor(Color.parseColor("#565656"));
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#4d4d4d")));
writeOnStatusBar("Hello world");
}

最佳答案

我认为(到目前为止)在Android上更改状态栏的内容是不可能的。您可以更改颜色或将其隐藏。

对于您想要的内容,您可以使用自定义工具栏并隐藏状态栏,在上面的图像中实现一些熟悉的

关于java - 如何在android状态栏上写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51932318/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com