Android: Help with two linear layout that overlaps each other! -
i have 2 linear layouts inside third parent layout. first linear layout orientation horizontal , second 1 vertical.
i tried achieve following code. however, second linear layout not appear.
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ffffff"> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_horizontal" > <imagebutton android:id="@+id/imagebutton01" android:layout_width="80px" android:layout_height="80px" android:background="@drawable/projects_badge" android:layout_margin="10px"/> </linearlayout> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:gravity="center_horizontal" > <imageview android:id="@+id/imageview01" android:layout_width="200px" android:layout_height="81px" android:src="@drawable/logo" android:adjustviewbounds="true" android:layout_margintop="15px"/> <textview android:id="@+id/textview01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:textcolor="#9cc721"/> </linearlayout> </linearlayout>
any appreciated.
thanks in advance.
i think need specify android:orientation
attribute inside parent layout well.
tips:
dp
, dip
more preferrable px.
update:
your parent layout should like:
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ffffff" android:orientation="vertical">
your image view in 2nd sub-layout should like:
<imageview android:id="@+id/imageview01" android:layout_width="200px" android:layout_height="81px" android:src="@drawable/logo" android:adjustviewbounds="true" android:layout_margintop="15px" android:scaletype="center"/>
Comments
Post a Comment