i have problem make design this
example image :
with in top content , bottom list view please help
how make content in top?
main.xml
<?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:orientation="vertical"> <listview android:id="@+id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:divider="#b5b5b5" android:dividerheight="1dp" android:listselector="@drawable/list_selector" /> </linearlayout>
and list_row.xml
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/list_selector" android:orientation="horizontal" android:padding="5dip" > <!-- listrow left sied thumbnail image --> <linearlayout android:id="@+id/thumbnail" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="3dip" android:layout_alignparentleft="true" android:background="@drawable/image_bg" android:layout_marginright="5dip"> <imageview android:id="@+id/list_image" android:layout_width="50dip" android:layout_height="50dip" android:src="@drawable/rihanna"/> </linearlayout> <!-- title of song--> <textview android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_aligntop="@+id/thumbnail" android:layout_torightof="@+id/thumbnail" android:text="rihanna love way lie" android:textcolor="#040404" android:typeface="sans" android:textsize="15dip" android:textstyle="bold"/> <!-- artist name --> <textview android:id="@+id/artist" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/title" android:textcolor="#343434" android:textsize="10dip" android:layout_margintop="1dip" android:layout_torightof="@+id/thumbnail" android:text="just gona stand there , ..." /> <!-- rightend duration --> <textview android:id="@+id/duration" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_aligntop="@id/title" android:gravity="right" android:text="5:45" android:layout_marginright="5dip" android:textsize="10dip" android:textcolor="#10bcc9" android:textstyle="bold"/> <!-- rightend arrow --> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/arrow" android:layout_alignparentright="true" android:layout_centervertical="true"/> </relativelayout>
i used http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/
use relativlayout.
use android:layout_alignparenttop="true"
Comments
Post a Comment