I have used FrameLayout
as a Fragment
container inside NestedScrollView
. It works fine when loading first Fragment
in FrameLayout
(Scrolling) but when i replace another Fragment
in FrameLayout
then it stopped showing content and scrolling as well
I tried set property android:fillViewport="true"
in NestedScrollview
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<ImageView
android:id="@+id/imgProfile"
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@drawable/icon_profile_image"
app:layout_constraintEnd_toStartOf="@+id/txtName"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/icon_add_round"
app:layout_constraintBottom_toBottomOf="@+id/imgProfile"
app:layout_constraintEnd_toEndOf="@+id/imgProfile" />
<TextView
android:id="@+id/txtName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:maxLines="2"
android:textColor="@color/text_dark"
android:textSize="18dp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/imgProfile"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/imgProfile"
app:layout_constraintTop_toTopOf="@+id/imgProfile" />
</android.support.constraint.ConstraintLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="@dimen/_10sdp"
android:background="@color/app_yellow" />
<FrameLayout
android:id="@+id/containerMain"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</LinearLayout>
I want to scroll as Fragment
Content but it works only first time