0

I have CirclePageIndicator with three fragments. What I want is to embed same header and footer in all the fragments. When the user swipes the fragments the header and footer should be seen and accessible all the time. I found a solution and tried this way but doing this way the circles get missing or disappear from the view. I spent a lots of time but could not solve. This is my xml layout how I tried to embed according to the link:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<android.support.v4.view.ViewPager
    android:id="@+id/viewpager"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1" >

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above = "@+id/footer"
        android:layout_below = "@+id/header" >

        <com.viewpagerindicator.CirclePageIndicator
            android:id="@+id/indicator"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" />
    </RelativeLayout>

    <!-- Footer aligned to bottom -->

    <RelativeLayout
        android:id="@+id/footer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="#FC0"
        android:gravity="center" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:text="Fixed Footer"
            android:textColor="#000"
            android:textSize="20sp" />
    </RelativeLayout>
</android.support.v4.view.ViewPager>

What am I doing wrong?

Community
  • 1
  • 1
bShah
  • 309
  • 1
  • 6
  • 19

1 Answers1

0

just put the circular indicator above the viewpager.. or they would swipe out with the pager..

<relative layout>
<circular indicator  />
<viewpager  ><---   ---->
</relative layout>
Akshay Sharma
  • 418
  • 3
  • 12