I have a simple LinearLayout with an ImageView and a normal view having layout weights 0.55 and 0.45 respectively.
I wasn't able to split unless I gave a weightsum to my LinearLayout.
After having my LinearLayout split, I tried to give a background color to my view but its not reflecting.
Below is my code:
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:weightSum="1" > <ImageView android:layout_weight=".55" android:layout_width="match_parent" android:layout_height="0dp" android:layout_marginTop="5dip" android:scaleType="fitXY" android:src="@drawable/ic_launcher_background" android:contentDescription="TODO" /> <View android:layout_weight=".45dp" android:layout_width="match_parent" android:layout_height="0dp" android:visibility="visible" android:background="@color/colorPrimary" ></View> </LinearLayout> I can't understand what shall be changed such that, I can split the views correctly and set the background color. Thanks in advance!