Android: what kind should I use to display text and image?

My application displays a list of elements, where each line is the title of the element with its own images, the line reserves 70% of the space for text and 30% for the image. Imagine what the iphone app store looks like. What kind of layout / layout compilation is recommended for this purpose?

I found google and found this article:

http://www.curious-creature.org/2009/02/22/android-layout-tricks-1/

Is this opinion good?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"

android:padding="6dip">

<ImageView
    android:id="@+id/icon"

    android:layout_width="wrap_content"
    android:layout_height="fill_parent"

    android:layout_alignParentTop="true"
    android:layout_alignParentBottom="true"
    android:layout_marginRight="6dip"

    android:src="@drawable/icon" />

<TextView
    android:id="@+id/secondLine"

    android:layout_width="fill_parent"
    android:layout_height="26dip" 

    android:layout_toRightOf="@id/icon"
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"

    android:singleLine="true"
    android:ellipsize="marquee"
    android:text="Simple application that shows how to use RelativeLayout" />

<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"

    android:layout_toRightOf="@id/icon"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:layout_above="@id/secondLine"
    android:layout_alignWithParentIfMissing="true"

    android:gravity="center_vertical"
    android:text="My Application" />

0
source share
2 answers

" iPhone- ", " " (, , , iPhone-), , , . "" RelativeLayout, . , , , , , LinearLayout LinearLayout, . . , LinearLayout.

. , , ListView. , ListViews, . , . , , , convertView.

: , , , .

+1

ListView . ListAdapter (SimpleAdapter/ArrayAdapter), . , , , getView .

+1

Source: https://habr.com/ru/post/1739236/


All Articles