Issue
I am Trying to scroll whole layout but I can't, only tablayout scroll and relative layout above the tablayout they can't scroll, how to fix it, I am trying to make like instagram profile or account fragment page... help to fix it... thanks in advance and I am using under tablayout framelayout not a viewpager and attach with framelayout fragment the 1st tab I can click then that fragment use the scroll, linear and the recyclerview that fragment call then whole layout scroll, but another second tab I can click then that fragment use the linear and gridview only and that fragment call then half layout scroll, where I am wrong please tell me...
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<RelativeLayout
android:id="@+id/relativelayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/imglayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/cvprofile"
android:layout_width="86dp"
android:layout_height="86dp"
app:civ_border_color="#a4a4a4"
app:civ_border_width="0.5dp"
android:layout_margin="12dp"
android:src="@drawable/img" />
</LinearLayout>
<LinearLayout
android:id="@+id/digitlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/imglayout"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_marginTop="12dp">
<TextView
android:id="@+id/post"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="100"
android:gravity="center"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/followers"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="100"
android:gravity="center"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold"/>
<TextView
android:id="@+id/following"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="43"
android:gravity="center"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:id="@+id/textlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/imglayout"
android:layout_below="@id/digitlayout"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_marginTop="2dp">
<TextView
android:id="@+id/posts"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="posts"
android:gravity="center"
android:textSize="16sp" />
<TextView
android:id="@+id/followerss"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="follwers"
android:textSize="16sp"
android:gravity="center"/>
<TextView
android:id="@+id/followings"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="follwers"
android:textSize="16sp"
android:gravity="center"/>
</LinearLayout>
<TextView
android:id="@+id/tvedit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/edit_profile"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_marginTop="10dp"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="@color/black"
android:background="@drawable/bg_textview"
android:layout_toRightOf="@id/imglayout"
android:layout_below="@id/textlayout"
android:gravity="center_horizontal"/>
<View
android:id="@+id/view1"
android:layout_below="@id/imglayout"
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#b6b6b6" />
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_below="@id/view1"
app:tabIndicatorHeight="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabGravity="fill"
app:tabMode="fixed">
<android.support.design.widget.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/frame1"/>
<android.support.design.widget.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/frame1" />
<android.support.design.widget.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/frame1" />
<android.support.design.widget.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/frame1" />
</android.support.design.widget.TabLayout>
<View
android:id="@+id/view2"
android:layout_below="@id/tabLayout"
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#b6b6b6" />
<FrameLayout
android:id="@+id/framelayout"
android:layout_below="@id/view2"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</RelativeLayout>
</ScrollView>
Solution
Try changing ScrollView to NestedScrollView
android.support.v4.widget.NestedScrollView
Answered By - arbrcr
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.