iam designin new app , and at some part i need two layouts on top of each other , but not using arndroid:orientation , insted of that i need to use layout_above/layout_below , but it says to me is a invalid parameter for LinearLayout here is the code
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/menu"
android:gravity="center">
<LinearLayout
android:id="@+id/t1"
android:layout_width="80dp"
android:gravity="center"
android:layout_height="80dp"
android:background="#DDDDDD">
</LinearLayout>
<LinearLayout
android:id="@+id/t2"
android:layout_width="80dp"
android:gravity="center"
android:layout_height="80dp"
android:background="#DDDDDD">
</LinearLayout>
<LinearLayout
android:id="@+id/t3"
android:layout_width="80dp"
android:gravity="center"
android:layout_above="@id/t1"
android:layout_height="80dp"
android:background="#DDDDDD">
</LinearLayout>
</LinearLayout>
so linear layouts t1 and t2 are next to each other witch is fine , but i want linearlayout t3 above t1
android:layout_above/layout_below are only allowed on RelativeLayout, use RelativeLayout instead of LinearLayout and it will work. Ex:
Here’s a good tutorial on layouts:
http://android.programmerguru.com/android-relativelayout-example/