Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to set the Tabview in the middle of the screen
    text
    copied!<p>I am trying to make an Android app in which I want to use a <code>Tabview</code> to navigate among the screens. When I am putting it at the bottom or at the top of the screen, it works fine. But according to the app requirements, I want to put it in the middle of the screen. i.e. in between the elements of the <code>FrameLayout</code>. Here is the code for two basic situations:</p> <p>(1) <strong>to put the <code>Tabview</code> at bottom:</strong> </p> <pre class="lang-xml prettyprint-override"><code>&lt;LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingTop="0dp"&gt; &lt;FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" /&gt; &lt;TabWidget android:id="@android:id/tabs" android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" /&gt; </code></pre> <p>(2) <strong>to put the <code>Tabview</code> at the Top:</strong></p> <pre class="lang-xml prettyprint-override"><code>&lt;LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingTop="0dp"&gt; &lt;TabWidget android:id="@android:id/tabs" android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" /&gt; &lt;FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" /&gt; </code></pre> <p>(3) <strong>What I want to do:</strong></p> <p>I want to put the <code>Tabview</code> in between the elements of the <code>FrameLayout</code>. To be more specific:</p> <pre class="lang-xml prettyprint-override"><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:id="@+id/now_lisn_view" android:layout_width="fill_parent" android:layout_height="fill_parent" style="@style/background"&gt; &lt;include android:id="@+id/main_header" android:layout_width="fill_parent" android:layout_height="wrap_content" layout="@layout/back_header" /&gt; &lt;include android:id="@+id/image_name_strip" android:layout_width="fill_parent" android:layout_height="wrap_content" layout="@layout/image_name_holder" android:layout_marginTop="5dip"/&gt; &lt;ListView android:layout_width="fill_parent" android:layout_height="fill_parent" android:divider="@color/listDivider" android:dividerHeight="1dp" android:footerDividersEnabled="false" android:headerDividersEnabled="true" style="@style/listBackground" android:id="@+id/list"/&gt; &lt;/LinearLayout&gt; </code></pre> <p>The above layout contains the elements of the <code>FrameLayout</code>. I want to put the <code>Tabview</code> just above the <code>ListView</code>. Is there any way to do it?</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