我无法应用"Theme.AppCompat.NoTitleBar"和"colorPrimaryDark"同时显示状态栏颜色 [英] i am unable to apply "Theme.AppCompat.NoTitleBar" and "colorPrimaryDark" status bar color property at the same time

查看:62
本文介绍了我无法应用"Theme.AppCompat.NoTitleBar"和"colorPrimaryDark"同时显示状态栏颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在整个应用程序中隐藏操作栏,还想设置状态栏的颜色吗?在Appcelerator Titanium中.

I want to hide the action bar throughout the application and also want to set the status bar color? in Appcelerator titanium.

推荐答案

请遵循官方指南,网址为 https://wiki.appcelerator.org/display/guides2/Android+Action+Bar

Please follow the official guide at https://wiki.appcelerator.org/display/guides2/Android+Action+Bar

您可以在open事件中将其隐藏在代码win.activity.actionBar.hide();中,并在主题xml中使用常规样式,也可以将主题中的父对象设置为 <style name="Theme.MyTheme" parent="Theme.AppCompat.NoTitleBar">.

You can either hide it in code win.activity.actionBar.hide(); in the open event and use a normal style in the theme xml or you set your parent in the theme to <style name="Theme.MyTheme" parent="Theme.AppCompat.NoTitleBar">.

状态栏颜色是一个主题项: <item name="android:statusBarColor">#ff0000</item>.您可以将其添加到主题中.

Statusbar color is a theme item: <item name="android:statusBarColor">#ff0000</item>. You can add into your theme.

以下是我正在使用的一种样式:

Here is a style I'm using as an example:

<style name="Theme.MyTheme" parent="Theme.AppCompat.NoTitleBar">
    <item name="colorPrimary">#212121</item>
    <item name="colorPrimaryDark">#000000</item>
    <item name="android:statusBarColor">#00d59e</item>
    <item name="colorAccent">#ff225c</item>
    <item name="android:textColorHint">#999999</item>
</style>

使用

"Window" : {
    theme: "Theme.MyTheme",
    barColor: "#ff225c"
}

这篇关于我无法应用"Theme.AppCompat.NoTitleBar"和"colorPrimaryDark"同时显示状态栏颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆