0
votes

I am trying to hide the action bar.

For the most part, following these instructions and creating a custom theme seems to work fine:

http://docs.appcelerator.com/platform/latest/#!/guide/Android_Action_Bar-section-src-36735509_AndroidActionBar-HidingtheActionBar

What I did was:

1) Added the following custom theme

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Theme.NoActionBar" parent="@style/Theme.AppCompat">
        <item name="android:windowActionBar">false</item>
        <item name="android:windowNoTitle">true</item>
        <!-- AppCompat Compatibility -->
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
</resources> 

2) Modify tiapp.xml

 <android xmlns:android="http://schemas.android.com/apk/res/android">
    <manifest>
        <application android:theme="@style/Theme.NoActionBar"/>
    </manifest>
</android>

And for the most part, the title does not appear. However, when you have a window with transparency, you can see the title bar again.

For example consider the following:

Parent Window

enter image description here

Note that there is no action bar here

Window with no transparency

"#win": {
    backgroundColor: "red",
}

enter image description here

Note that the action bar is still not visible

Window with some transparency

"#win": {
    backgroundColor: "red",
    opacity: 0.5,
}

enter image description here

2

2 Answers

3
votes

Titanium includes a couple pre-defined themes you can use if you just want to hide the actionbar. http://docs.appcelerator.com/platform/latest/#!/guide/Android_Themes-section-src-34636181_AndroidThemes-TitaniumThemes

I think both Theme.AppCompat.Translucent.NoTitleBar and Theme.AppCompat.Translucent.NoTitleBar.Fullscreen are interesting for you.

If you specify this in the [controller].tss (or .xml for the Window property using the theme: property you should be golden.

<Window theme="Theme.AppCompat.Translucent.NoTitleBar">
0
votes

Just add style in tiapp.xml

 <android 
    xmlns:android="http://schemas.android.com/apk/res/android">
    <manifest android:versionCode="16" android:versionName="4.1">
      <application android:theme="@style/Theme.AppCompat.Translucent.NoTitleBar.Fullscreen">
        <activity android:configChanges="keyboardHidden|orientation" android:grantUriPermissions="true" android:screenOrientation="portrait" android:textAllCaps="false"/>
      </application>
    </manifest>
  </android>