android relativelayout: the last viewgroup won't get over the header? -
i want last viewgroup id chats overlap previous viewgroups , occupy whole screen of phone. xml code below presume want. codes not. please help.
below xml codes.
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/root" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.testapp.mainactivity"> <linearlayout android:id="@+id/bar" android:layout_alignparentstart="true" android:orientation="horizontal" android:gravity="center_vertical" android:background="#999999" android:elevation="10dp" android:layout_width="match_parent" android:layout_height="40dp"> <imageview android:id="@+id/bar_img" android:src="@drawable/ic_autorenew_black_24dp" android:gravity="clip_vertical" android:paddingstart="8dp" android:layout_width="36dp" android:layout_height="36dp" /> <textview android:id="@+id/bar_title" android:text="title" android:ellipsize="end" android:layout_weight="1" android:gravity="center" android:textcolor="#ffffff" android:textstyle="bold" android:textsize="18sp" android:layout_width="0dp" android:layout_height="wrap_content" /> </linearlayout> <framelayout android:id="@+id/root_frag" android:layout_below="@id/bar" android:layout_width="match_parent" android:layout_height="match_parent"></framelayout> <linearlayout android:id="@+id/chats" android:background="#ea2312" android:orientation="vertical" android:layout_alignparentstart="true" android:layout_width="match_parent" android:layout_height="match_parent"> <linearlayout android:id="@+id/chat_list" android:orientation="vertical" android:layout_width`enter code here`="match_parent" android:layout_height="wrap_content"> <textview android:text="hello world" android:layout_width="match_parent" android:layout_height="wrap_content" /> </linearlayout> </linearlayout> </relativelayout>
this preview screenshot.
the "chats" linearlayout
does fill whole screen, "bar" linearlayout
appears on top of (even though it's defined earlier inside relativelayout
) because of android:elevation
attribute.
to make stop, either remove elevation
attr "bar" view, or add (larger) elevation
attr "chats" view.
Comments
Post a Comment