titaniumappceleratortitanium-mobileappcelerator-titaniumappcelerator-mobile

Unable to apply both "Theme.AppCompat.NoActionBar" and "Theme.AppCompat.Light" at the same time


I am using

<style name="MyThemeActionbar" parent="@style/Theme.AppCompat.Light">
<item name="colorAccent">#0d786e</item>
</style> 

and also

<style name="MyThemeActionbar1" parent="@style/Theme.AppCompat.NoActionBar">
      <item name="android:statusBarColor">#003300</item>

    </style> 

this style globally . Both are not working at a time. May I know why?


Solution

  • Setting up a test app with your themes:

    var win = Ti.UI.createWindow({
        backgroundColor: '#fff',
        theme: "MyThemeActionbar1"
    });
    
    var btn = Ti.UI.createButton({
        title: "open"
    });
    
    btn.addEventListener("click",function(){
        var win2 = Ti.UI.createWindow({
            backgroundColor: '#fff',
            theme: "MyThemeActionbar"
        });
        win2.open();
    
    })
    win.add(btn);
    win.open();
    

    is working fine for me.

    Theme file:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <style name="MyThemeActionbar1" parent="@style/Theme.AppCompat.NoActionBar">
            <item name="android:statusBarColor">#003300</item>
        </style>
    
        <style name="MyThemeActionbar" parent="@style/Theme.AppCompat.Light">
            <item name="colorAccent">#0d786e</item>
        </style>
    </resources>