Titanium - 为特定 window 隐藏 Android actionBar
Titanium - Hiding Android actionBar for specific window
我正在尝试隐藏特定 window 的 actionBar。我遵循了这个:http://www.appcelerator.com/blog/2014/08/hiding-the-android-actionbar/ 过去曾为我工作。
我所做的是创建一个这样的自定义主题:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.NoActionBar" parent="@style/Theme.AppCompat">
<item name="android:windowNoTitle">true</item>
</style>
<style name="Theme.YesActionBar" parent="@style/Theme.AppCompat">
<item name="android:windowNoTitle">false</item>
</style>
</resources>
我在 tiapp.xml
中设置了以下内容:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
</manifest>
</android>
并且我在 window tss
中设置了以下内容:
"Window[platform=android]" : {
theme: 'Theme.NoActionBar'
}
但操作栏仍然显示。如果我在 window 打开事件的代码中隐藏它,而不是它会剪切我拥有的背景图像 - 所以我宁愿用主题来做。
如何在 sdk 5.2.0 上隐藏带有主题的操作栏?
我可以通过将自定义主题更改为以下内容来解决问题:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.NoActionBar" parent="@style/Theme.AppCompat">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.YesActionBar" parent="@style/Theme.AppCompat">
<item name="windowActionBar">true</item>
<item name="windowNoTitle">false</item>
</style>
</resources>
我正在尝试隐藏特定 window 的 actionBar。我遵循了这个:http://www.appcelerator.com/blog/2014/08/hiding-the-android-actionbar/ 过去曾为我工作。
我所做的是创建一个这样的自定义主题:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.NoActionBar" parent="@style/Theme.AppCompat">
<item name="android:windowNoTitle">true</item>
</style>
<style name="Theme.YesActionBar" parent="@style/Theme.AppCompat">
<item name="android:windowNoTitle">false</item>
</style>
</resources>
我在 tiapp.xml
中设置了以下内容:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
</manifest>
</android>
并且我在 window tss
中设置了以下内容:
"Window[platform=android]" : {
theme: 'Theme.NoActionBar'
}
但操作栏仍然显示。如果我在 window 打开事件的代码中隐藏它,而不是它会剪切我拥有的背景图像 - 所以我宁愿用主题来做。
如何在 sdk 5.2.0 上隐藏带有主题的操作栏?
我可以通过将自定义主题更改为以下内容来解决问题:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.NoActionBar" parent="@style/Theme.AppCompat">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.YesActionBar" parent="@style/Theme.AppCompat">
<item name="windowActionBar">true</item>
<item name="windowNoTitle">false</item>
</style>
</resources>