1

アプリのデザインに取り組んでいますが、ListView の項目のデザインに問題があります。

それがどのように見えるか、そして私がそれをどのように望んでいたかを見つけることができます。

アイテムのレイアウトは次のとおりです。

<TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/activatedBackgroundIndicator"
android:minHeight="?android:attr/listPreferredItemHeight" >

        <TextView android:id="@android:id/text1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="?android:attr/listPreferredItemPaddingLeft"
            android:layout_marginTop="8dip"
            android:textAppearance="?android:attr/textAppearanceListItem"
        />


        <RelativeLayout android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_alignParentRight="true" >

            <ImageView
            android:id="@+id/favourite_status"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_alignParentRight="true"
            android:layout_alignTop="@android:id/text1"
            android:src="@drawable/is_not_favourite"
            android:contentDescription="@string/list_favorites_status"
            android:background="@null"
            android:layout_margin="9dp"/>

        </RelativeLayout>

        <TextView android:id="@android:id/text2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@android:id/text1"
            android:layout_alignLeft="@android:id/text1"
            android:textAppearance="?android:attr/textAppearanceMedium"
        />



  </TwoLineListItem>

問題はテキストです。空のはずのスペースに説明があふれないようにします。助けてくれてありがとう。

どのように見えるか

それがどうあるべきか

4

1 に答える 1

0

簡単に、次のことができます。

<LinearLayout
    ....
    android:orientation="horizontal" 
    ....>
    <LinearLayout
        ....
        android:orientation="vertical" 
        ....>
        <TextView />
        <TextView />
    </LinearLayout>
    <ImageView />
</LinearLayout>

これは基本的なレイアウトです。RelativeLayout でも同じことができます。

于 2012-04-30T09:35:45.930 に答える