首页 > 解决方案 > 我无法同时应用“Theme.AppCompat.NoTitleBar”和“colorPrimaryDark”状态栏颜色属性

问题描述

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

标签: androidappceleratorappcelerator-titaniumappcelerator-mobileappcelerator-studio

解决方案


我将自定义主题文件保存在里面

App->Platform->Android->res->values->mytheme.xml

我的 xml 文件如下所示,对我来说效果很好..

 <resources>
    <style name="Theme.MyTheme" parent="Theme.AppCompat.NoTitleBar.Fullscreen">
        <item name="buttonStyle">@style/MyButton</item>
    </style>
    <style name="MyButton" parent="Widget.AppCompat.Button">
        <item name="android:textAllCaps">false</item>
    </style>
</resources>

并在 maifest 内的 tiapp.xml 文件中

<application android:theme="@style/Theme.MyTheme"/>

推荐阅读