0

i have to use view pager and horizontal scroll view .the view pager contains three fragments. when we swipe it moves according to swipe.in each fragment has unique titles say like one , two, three.when we swipe the view pager, title also get scroll according to the fragments. for this i have use it is not working properly...horizontal scroll view text(one,two,three) not scroll..only view pager get scrolled any solution?

  <RelativeLayout>
        <android.support.v4.view.ViewPager
            android:id="@+id/myviewpager"

            android:layout_width="match_parent"
            android:layout_height="match_parent">


            <android.support.v4.view.PagerTitleStrip
                android:id="@+id/titlestrip"
                android:layout_width="match_parent"

                android:layout_height="wrap_content"
                android:visibility="gone" />

        </android.support.v4.view.ViewPager>

        <HorizontalScrollView
            android:id="@+id/hori"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="50dp">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="50dp"

                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"

                    android:text="one"
                    android:textSize="28sp"
                    android:layout_marginLeft="150dp"
                    android:textStyle="bold" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="100dp"
                    android:text="two"
                    android:textSize="28sp"

                    android:textStyle="bold" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="100dp"
                    android:text="three"
                    android:textSize="28sp"

                    android:textStyle="bold" />
            </LinearLayout>

        </HorizontalScrollView>
</RelativeLayout>
Booshan
  • 97
  • 1
  • 3
  • 11
  • page title strip actually not scrolls with fragments...it scroll only when the fragment reach its end – Booshan Sep 05 '15 at 10:49
  • can you post total xml and code? – IntelliJ Amiya Sep 05 '15 at 11:17
  • http://stackoverflow.com/questions/8594361/horizontal-scroll-view-inside-viewpager Here's a link to the same question you've asked. – user3136591 Sep 05 '15 at 11:20
  • this is the whole xml...view pager is first placed and horizontal scroll view is next placed in relative layout – Booshan Sep 05 '15 at 11:58
  • @ user3136591 44 : i saw the link i dont have idea ,where to place my horizontal scroll view.. since it act as a header so it is in top...either it should be placed under viewpager view or not? – Booshan Sep 05 '15 at 12:09
  • getParent().requestDisallowInterceptTouchEvent(true); this will disable the scroll...instead i have to make my scroll view scroll with fragments...any idea about this – Booshan Sep 05 '15 at 12:16
  • my exact sceneraio is to make my horizontal scroll view scroll with view pager scroll – Booshan Sep 05 '15 at 12:23

0 Answers0