android - Fill RelativeLayout parent with LinearLayout child -


this seems simple i've exhausted google search patience.

i have relativelayout has 2 sub linearlayouts side-by-side , want them both vertically fill parent, no matter height of 2 linearlayouts. being used listview row , content under @id/item_left shorter 1 on right.

the background drawable doesn't fill entire row.

any ideas on making both sides fill?

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="fill_parent">     <linearlayout android:id="@+id/item_left"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:paddingright="2dp"         android:paddingleft="2dp"         android:background="@drawable/item_left"         android:orientation="vertical">         <textview android:id="@+id/time"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:textcolor="@color/item_left_text"             android:text="" />     </linearlayout>      <linearlayout         android:layout_width="match_parent"         android:layout_height="match_parent"         android:orientation="vertical"         android:background="@color/item_right_background"         android:layout_torightof="@id/item_left">                    <textview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:textcolor="@color/item_right_text"             android:text="row1" />          <textview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:textcolor="@color/item_right_text"             android:text="row2" />          <textview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:textcolor="@color/item_right_text"             android:text="row3" />     </linearlayout> </relativelayout> 

try code .... sorry changed color impact when change text of first textview

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent" android:layout_height="fill_parent"     android:background="#ffffffff" android:weightsum="1">      <linearlayout android:id="@+id/item_left"         android:layout_width="wrap_content" android:layout_height="fill_parent"         android:paddingright="2dp" android:paddingleft="2dp"         android:background="#ff0000ff" android:orientation="vertical" >         <textview android:id="@+id/time" android:layout_width="wrap_content"             android:layout_height="wrap_content" android:textcolor="#ff555555"             android:text="sdfdsf s ada d   asd sad sad"  />     </linearlayout>      <linearlayout android:layout_width="wrap_content"         android:layout_height="match_parent" android:orientation="vertical"         android:background="#ffff0000"          android:layout_weight="1" >         <textview android:layout_width="wrap_content"             android:layout_height="wrap_content" android:textcolor="#ff555555"             android:text="row1" />          <textview android:layout_width="wrap_content"             android:layout_height="wrap_content" android:textcolor="#ff00ff00"             android:text="row2" />          <textview android:layout_width="wrap_content"             android:layout_height="wrap_content" android:textcolor="#ff00ff00"             android:text="row3" />     </linearlayout>   </linearlayout> 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -