android - Representing views across several RelativeLayouts in one list item -


i'm trying have 3 text views in 1 list item. challenge list item formatted card, 2 different colors (pictured here). accomplished different colors through creative 2 different relativelayout pictured here.

my xml formatting list items correctly, it's not containing 3 views. ends creating 3 list items 2 contain {view 2} , 1 contains {view 1}. causing below xml not group 3 views 1 list item , how can remedied?

<?xml version="1.0" encoding="utf-8"?> <relativelayout     xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical"     android:layout_width="match_parent"     android:padding="2dp"     android:layout_height="match_parent">       <relativelayout         android:layout_width="80dp"         android:layout_height="wrap_content"         android:id="@+id/outer"         android:padding="3dp"         android:background="#08445e"         android:layout_toleftof="@+id/button"         android:layout_alignparentleft="true"         android:layout_alignparentstart="true">          <textview             android:id="@+id/textviewroom"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:text="room "             android:textcolor="#fff"             android:layout_alignparentleft="true"/>          <textview             android:id="@+id/textviewtime"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:text="time: "             android:layout_alignparentright="true"             android:textcolor="#fff" />      </relativelayout>      <relativelayout         android:layout_width="match_parent"         android:layout_height="50dp"         android:id="@+id/inner"         android:background="#d1d1d1"         android:layout_below="@+id/outer"         android:layout_alignparentleft="true"         android:layout_alignparentstart="true"         android:layout_toleftof="@+id/button"         android:layout_tostartof="@+id/button">          <textview             android:id="@+id/textviewrequest"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_centervertical="true"             android:textcolor="#000"             android:textsize="20sp"             android:layout_centerhorizontal="true" />      </relativelayout>  </relativelayout> 

try have made changes in xml

<?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="wrap_content"     android:orientation="vertical">       <relativelayout         android:id="@+id/outer"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_alignparentleft="true"         android:layout_alignparentstart="true"         android:layout_toleftof="@+id/button"         android:padding="5dp"         android:background="#08445e">          <textview             android:id="@+id/textviewroom"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_alignparentleft="true"             android:text="room {room}"             android:textcolor="#fff" />          <textview             android:id="@+id/textviewtime"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_alignparentright="true"             android:text="time: {time} sec"             android:textcolor="#fff" />      </relativelayout>      <relativelayout         android:id="@+id/inner"         android:layout_width="match_parent"         android:layout_height="50dp"         android:layout_alignparentleft="true"         android:layout_alignparentstart="true"         android:layout_below="@+id/outer"         android:layout_toleftof="@+id/button"         android:layout_tostartof="@+id/button"         android:background="#d1d1d1">          <textview             android:id="@+id/textviewrequest"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_centerhorizontal="true"             android:layout_centervertical="true"             android:textcolor="#000"             android:text="{view 1}"             android:textsize="20sp" />      </relativelayout>  </linearlayout> 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -