I have 3 fragments aligned horizontally. I am using Relative layout for the last fragment. When I provide an ImageView in the last fragment/layout (RelativeLayout) it actually squeeze/shrinks the imageview . But when I use LineraLayout it does not. How can I get the same effect in RelativeLayout. ie with out squeezing/shrinking the components. Any help is appreciated
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#58595B">
<ImageView
android:id="@+id/imgProfilePhoto"
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_centerInParent="true"
android:background="@drawable/contact_avatar_default_1" />
</RelativeLayout>
Main Layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:animateLayoutChanges="true">
<FrameLayout
android:id="@+id/container1"
android:layout_width="400dp"
android:layout_height="match_parent"
tools:context="com.sample.MainActivity"
tools:ignore="MergeRootFrame" />
<FrameLayout
android:id="@+id/container2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="#E6E6E6"
android:layout_weight="90"
tools:ignore="MergeRootFrame" />
<fragment
android:id="@+id/fragmentContact"
android:name="com.sample.photoFragment"
android:layout_width="0dp"
tools:layout="@layout/fragment_photo"
android:layout_height="match_parent"
android:layout_weight="10" />