0

i m using viewpager now before viewpager there is a tablayout and videoview as well.so my viewpager fragments contents are large then it must show inside scrollview so how can i show viewpagers fragment view in scrollable area ? once i m taking scrollview as parent layout inside fragments view then viewpager is not displaying any fragment? how to resolve this ? i have to make my viewpagers fragment as scrollable

  <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
   <RelativeLayout
       android:id="@+id/rlayout_detailvideo"
       android:layout_width="match_parent"
       android:layout_height="300dp"
       android:visibility="visible">

    <com.app.VideoViewCustom android:id="@+id/videoplayer"
        android:layout_width="match_parent"
        android:layout_height="300dp"
       />
       <ImageView
           android:id="@+id/imageview_videodetailbackarrow"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:src="@drawable/video_detail_back_btn"
           android:padding="15dp"
           android:layout_alignParentLeft="true"
           android:layout_marginLeft="@dimen/videodetail_backarrow_marginleft"
           android:layout_marginTop="@dimen/videodetail_backarrow_margintop"/>
       <ImageView
           android:id="@+id/imageview_edit"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:src="@drawable/video_detail_edit_btn"
           android:padding="15dp"
           android:layout_alignParentRight="true"
           android:layout_marginRight="@dimen/videodetail_edit_marginright"
           android:layout_marginTop="@dimen/videodetail_backarrow_margintop"/>
       <ImageView
           android:id="@+id/imageview_bottom"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:src="@drawable/video_detail_fullscreen_btn"
           android:padding="15dp"
           android:layout_alignParentBottom="true"
           android:layout_alignParentRight="true"
           android:layout_marginRight="@dimen/videodetail_edit_marginright"
           android:layout_marginTop="@dimen/videodetail_backarrow_margintop"/>

   </RelativeLayout>
    <android.support.design.widget.TabLayout
        android:id="@+id/videodetail_tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:tabGravity="fill"
        app:tabIndicatorColor="@color/actionbar_backgroundcolor"
        app:tabIndicatorHeight="3dp"
        android:layout_below="@+id/rlayout_detailvideo"
        android:background="#ffffff"
        />
     <!--style="@style/MyCustomTabLayout"-->

    <View
        android:id="@+id/view_videodetail"
        android:layout_height="1dp"
        android:layout_width="match_parent"
        android:background="@android:color/darker_gray"
        android:layout_below="@+id/videodetail_tabs"
        />
    <android.support.v4.view.ViewPager
        android:id="@+id/videodetail_pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:layout_below="@+id/view_videodetail"
        android:layout_marginTop="@dimen/infotab_layout_margintop"
        />
</RelativeLayout>

how can i make viewpagers fragment layout as scrollable ?

Erum
  • 790
  • 3
  • 14
  • 36
  • possible duplicate of [How to determine when Fragment becomes visible in ViewPager](http://stackoverflow.com/questions/10024739/how-to-determine-when-fragment-becomes-visible-in-viewpager) – Maveňツ Sep 11 '15 at 06:02
  • @maveň try to understand the question first – Erum Sep 11 '15 at 06:42

1 Answers1

0

First we can take Scroll view , then single child Linear Layout .Create your design in this linear layout.

<FrameLayout
        android:id="@+id/product_center_diamond_fragments"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="@dimen/margin_5"
        >



        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="wrap_content" 
            android:overScrollMode="never">

            <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                 >
                .....................
               Design your UI 

................................

Like that .

Md Maidul Islam
  • 2,294
  • 3
  • 17
  • 22
  • i have used recyclerview inside my Fragments UI so now using scrolview+linearlayou my recyclerview is not displaying – Erum Sep 11 '15 at 07:12