Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Android navBarHidden on app start

On Android, is it possible to start an app with the navBarHidden set to true, so that the splash screen doesn't show Nav Bar and quickly hide it again because the first window loaded has it hidden? I know there are some settings like this in tiapp.xml file, but I can't seem to find this one.

— asked August 2nd 2010 by Andrew Scofield
  • android
  • navbarhidden
  • screen
  • splash
0 Comments

5 Answers

  • Accepted Answer

    in your project navigate to build/android/res/values/theme.xml and change its contents to the following

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
    <style name="Theme.Titanium" parent="android:Theme.NoTitleBar.Fullscreen">
    <item name="android:windowBackground">@drawable/background</item>
    </style>
    </resources>

    "android:Theme.NoTitleBar.Fullscreen" will give you a splash screen that is displayed as fullscreen, however, this seems to be overwritten after every "full" recompile

    — answered August 8th 2010 by Christian Sigl
    permalink
    1 Comment
    • Every time I tried to run it on Emulator, the theme.xml was overwritten. However, I was able to fix it with the help of this answer.

      — commented June 21st 2012 by Sufian Babri
  • In tiapp.xml file change this
    <fullscreen>true</fullscreen>
    <navbar-hidden>true</navbar-hidden>

    — answered September 17th 2012 by shahid nasrullah
    permalink
    1 Comment
    • this worked for me, you just have to set navbarhidden to true on windows you want to show it in your code

      — commented July 31st 2013 by Citrus Yiman
  • Copy the file build/android/res/values/theme.xml change it to

    <?xml version="1.0" encoding="utf-8"?> <resources> <style name="Theme.Titanium" parent="android:Theme.NoTitleBar.Fullscreen"> <item name="android:windowBackground">@drawable/background</item> </style> </resources>

    place the same file structure in your root directory under a folder called platform.

    — answered December 7th 2011 by Jesper Persson
    permalink
    1 Comment
    • Thank you! I tried everything I could think of before finding your answer. NOTE that you need the complete dir structure under "platform" – i.e. in app root, same level as "build", you need root/platform/android/res/values/theme.xml where theme.xml has content as you describe, above.

      – Andy

      — commented December 13th 2011 by Andy Felong
  • I want to know as well.

    — answered August 8th 2010 by Aee Q
    permalink
    0 Comments
  • If you just want the NavBar hidden, then you can set the parent theme to android:Theme.NoTitleBar which hides the navbar but leaves the notification bar.

    — answered August 8th 2010 by Joe Brinkman
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.