Reputation: 119
Generally PagerTabStrip appears at the top of screen just below appbar, Now I want PagerStrip to be at bottom , how can I set it to bottom of screen? Help me out.. Code:
<LinearLayout
android:id="@+id/main_container"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".AppHomeScreen"
xmlns:app="http://schemas.android.com/apk/res-auto">
<include
android:id="@+id/appbar"
layout="@layout/app_bar_layout"
/>
<android.support.v4.widget.DrawerLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/drawer">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/content_container">
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.PagerTabStrip
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#0ff"
android:id="@+id/pager_tabs"
android:layout_alignParentBottom="true"
>
</android.support.v4.view.PagerTabStrip>
</android.support.v4.view.ViewPager>
</RelativeLayout>
<fragment
android:layout_width="200dp"
android:layout_height="match_parent"
app:layout="@layout/fragment_navigation_drawer"
android:layout_gravity="right"
android:name="neppro.com.busapp.NavigationDrawerFragment"
tools:layout="@layout/fragment_navigation_drawer"/>
</android.support.v4.widget.DrawerLayout>
Now, this is latest updated code of mine where I have used Relative layout for viewPager , but I already have tried using LinearLayout also.
Upvotes: 0
Views: 730
Reputation: 2321
Set the layout_gravity attribute on your PagerTabStrip to "bottom"
android:layout_gravity="bottom"
Upvotes: 1