Note that there are some explanatory texts on larger screens.

plurals
  1. POSet tab above action bar
    text
    copied!<p>I have some issues with action bar and tabs navigation. Actually I want to set my tabs to be above my Action Bar. (I used Sherlock Action Bar).</p> <p>I saw that some people had problems because when they enable did :</p> <pre><code>ab.setDisplayShowTitleEnabled(false); </code></pre> <p>Tabs of their tabhost was above their ActionBar but it's exactly what I want. Here is my code : </p> <pre><code>ActionBar ab = getSupportActionBar(); //getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); ab.setCustomView(R.layout.action_wifisettings); ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); ab.setDisplayShowTitleEnabled(false); ab.setDisplayShowHomeEnabled(false); ab.setDisplayUseLogoEnabled(false); ab.setDisplayShowCustomEnabled(true); </code></pre> <p>and the xml file corresponding to my action bar :</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="bottom"&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FFFFFF" android:text="@string/wifi_title" android:layout_marginLeft="10dp" android:id="@+id/action_page_title" android:layout_centerVertical="true" android:textSize="16sp" /&gt; &lt;CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/action_page_title" android:layout_marginLeft="40dp" android:textColor="#FFFFFF" android:layout_centerVertical="true" android:text="@string/checkbox_title" android:id="@+id/action_checkbox_wifi" android:textSize="16sp" /&gt; &lt;ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_marginRight="10dp" android:layout_centerVertical="true" android:contentDescription="@string/wifi_refresh_desc" android:background="@drawable/ic_refresh_selector" android:id="@+id/action_wifi_refresh" android:textSize="12sp" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>If you know how to set my action bar to be behind my tabs it could be great. Thanks.</p>
 

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