Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><img src="https://i.stack.imgur.com/JG9qU.png" alt="enter image description here"></p> <hr> <p><strong>without use actionbarshearlock:</strong></p> <hr> <p>just add this line: <code>requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);</code> </p> <p>before <code>setContentView(R.Layout.Test)</code> in <code>onCreate</code></p> <p>and this line give you <code>TRANSPARENT ActionBar</code></p> <pre><code>getActionBar().setBackgroundDrawable( getResources().getDrawable(R.drawable.ab_bg_black)); </code></pre> <p>like:</p> <pre><code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY); setContentView(R.layout.activity_main); getActionBar().setBackgroundDrawable( getResources().getDrawable(R.drawable.ab_bg_black)); } </code></pre> <p>for R.drawable.ab_bg_black just add drawable colour in string.xml like:</p> <pre><code>&lt;drawable name="ab_bg_black"&gt;#80000000&lt;/drawable&gt; </code></pre> <hr> <p><strong>same way using actionbarshearlock:</strong></p> <hr> <pre><code>@Override protected void onCreate(Bundle savedInstanceState) { setTheme(SampleList.THEME); //Used for theme switching in samples requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY); super.onCreate(savedInstanceState); setContentView(R.layout.overlay); //Load partially transparent black background getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_bg_black)); } </code></pre> <hr> <p><strong>Edited:</strong> <strong><code>Start listview After Actionbar.</code></strong></p> <p><img src="https://i.stack.imgur.com/jLjq1.png" alt="enter image description here"></p> <p>if you are using actionbarshearlock then just do like below:</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; &lt;ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingLeft="10dp" android:paddingRight="10dp" android:paddingTop="?actionBarSize" &gt; &lt;/ListView&gt; &lt;/LinearLayout&gt; </code></pre>
 

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