Search code examples
androidandroid-themeandroid-stylesandroid-background

custom actionbar with height how to set background to full screen


do you know how can i set full screen background color (i need it when application start) when i have custom actionbar with 120dp height in theme. My actionbar style:

  <style name="MyActionBar"
     parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
   <item name="android:height">120dp</item>
   <item name="android:displayOptions"></item>
   <item name="android:background">#00000000</item>
  </style>

I want to set something like full screen color background "behind" this actionbar. This style have transparent background so if i could set some color behind it will look as i want, but i don't know how...


Solution

  • i found solution for my issue. I have to create splash screen to get what i want. If anyone have similar problem so shoud create splash screen. To done this you have to:

    1. Creating a drawable resource for the splash screen.
    2. Defining a new theme that will display the drawable resource.
    3. Adding a new Activity to the application that will be used as the splash screen defined by the theme created in the previous step.

    Here is a simple example how to do this: https://www.bignerdranch.com/blog/splash-screens-the-right-way/