Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want your activity to be fullscreen but still show an actionbar, but with an alpha you have to request overlaymode for the actionbar in <code>onCreate()</code> of your activity:</p> <pre><code>getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY); //getWindow().requestFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY); &lt;&lt; Use this for API 7+ (v7 support library) </code></pre> <p>Then <strong>after</strong> you call <code>setContentView(..)</code> (since <code>setContentView(..)</code> also initializes the actionbar next to setting the content) you can set a background drawable on your actionbar:</p> <pre><code>getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.actionbar_bg)); </code></pre> <p>which can be a shape drawable with an alpha put in res/drawable:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"&gt; &lt;solid android:color="#BB000000" /&gt; &lt;/shape&gt; </code></pre> <p>You could also do this completely programatically by creating a <code>ColorDrawable</code>:</p> <pre><code>getActionBar().setBackgroundDrawable(new ColorDrawable(Color.argb(128, 0, 0, 0))); </code></pre> <p>Otherwise ofcourse you can hide the actionbar completely; in that case you can set a custom theme on your activity in your manifest:</p> <pre><code>@android:style/Theme.NoTitleBar.Fullscreen </code></pre> <p>or programmatically by calling </p> <pre><code>getActionBar().hide(); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload