I am having problem in attaching fragment to RelativeLayout when the RelativeLayout has been put inside ScrollView. Please see the xml code belove -
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:obs="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="48dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:textColor="#9982d6"
android:textSize="20sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:textColor="#9982d6"
android:textSize="20sp"/>
</RelativeLayout>
<View
android:id="@+id/topDivider2"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#9982d6"
/>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="#848484"
android:textSize="14sp" />
<View
android:layout_width="match_parent"
android:layout_height="3.5dp"
android:layout_alignParentBottom="true"
android:background="#4ccdd9"
android:visibility="gone" />
<View
android:layout_width="5dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_marginBottom="4dp"
android:layout_marginTop="4dp" />
</RelativeLayout>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:dividerHeight="0dp" />
</LinearLayout>
</ScrollView>
In above xml code I have to attach a fragment inside RelativeLayout GraphContainer which is not working. Attaching fragment works if I don't use ScrollView. Please help...