/ / Niestandardowe wyrównanie listview w systemie Android - Android, układ androida, lista-androidów

Niestandardowe wyrównanie listview w Androidzie - Android, układ androida, lista-androidów

Tworzę plik xml widoku listy niestandardowej. Plik Xml zawierający dwa obrazy i cztery tekstowe

Tutaj Mój kod pliku 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" >

<ImageView
android:id="@+id/imgproperty"
android:layout_width="70dip"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="/images/@drawable/ic_launcher" />

<TextView
android:id="@+id/StreetName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="14dp"
android:layout_toRightOf="@+id/imgproperty"
android:text="Street Name:"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/lstlocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/StreetName"
android:layout_below="@+id/StreetName"
android:text="Location:"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/lstsquare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/lstlocation"
android:layout_alignLeft="@+id/StreetName"
android:text="SquareFootage:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/lstprice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/lstsquare"
android:layout_alignLeft="@+id/StreetName"
android:text="Price:"
android:textAppearance="?android:attr/textAppearanceMedium" />

<ImageView
android:id="@+id/imglike"
android:layout_width="30dip"
android:layout_height="30dip"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="8dip"
android:src="/images/@drawable/star1" />

</RelativeLayout>

Tutaj moje wyniki wprowadź opis obrazu tutaj

** chcę ustawić pierwszą szerokość obrazu jest pełnoekranowy wiersz Listview **

Proszę zasugerować, w jaki sposób ustawić szerokość obrazu Pełna wiersz widoku listy

Z góry dziękuję

Odpowiedzi:

0 dla odpowiedzi № 1

Dodaj android:scaleType="fitXY" atrybut do pierwszego ImageView XML w następujący sposób ...

<ImageView
android:id="@+id/imgproperty"
android:layout_width="70dip"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:scaleType="fitXY"
android:src="/images/@drawable/ic_launcher" />

0 dla odpowiedzi nr 2

ustaw android: layout_height = "80dp" względnego układu spróbuj tego. nie jest to konieczne, aby ustawić 80dp dać dowolny rozmiar dp, który uważasz za poprawny

tutaj jest wynik

wydajność