How to avoid two linearLayout overlapping each other in Android? -
i tried set 4 buttons @ bottom of screen , make imageview fill rest place. however, tried "0dp" + "weight=1" method , several other ways suggested online (can't remember ways have tried now), imageview still fills whole screen buttons on it.
<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:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:paddingbottom="@dimen/activity_vertical_margin" tools:context=".mainactivity"> <linearlayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="match_parent" android:background="@android:color/white"> <imageview android:id="@+id/viewimage" android:layout_width="match_parent" android:layout_height="match_parent" /> <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/runtime" android:text="rendering......" android:singleline="true" android:textcolor="#666666" android:textsize="14dip" android:visibility="gone"/> </linearlayout> <linearlayout android:id="@+id/btnslayout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:background="@android:color/black"> <button android:id="@+id/btnselectphoto" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.25" android:text="select photo"/> <button android:id="@+id/btnsavephoto" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.25" android:text="save photo"/> <button android:id="@+id/btnlocalfilter" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.25" android:text="local filter"/> <button android:id="@+id/btncloudfilter" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.25" android:text="cloud filter"/> </linearlayout> </relativelayout>
set android:layout_above="@+id/btnslayout"
in first linearlayout
:
<linearlayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="match_parent" android:background="@android:color/white" android:layout_above="@+id/btnslayout"> ... </linearlayout>
Comments
Post a Comment