Guruh talabasi Abdiyev Husniddin Adapter bo‘yicha qo‘llanma Android Studioda misol


Download 1.52 Mb.
bet6/6
Sana24.12.2022
Hajmi1.52 Mb.
#1059102
1   2   3   4   5   6
Bog'liq
ikkThU3JL2PtvpQdAhw1K9PkoBTZJi-x

5-qadam: Yangi tartib yarating-> rec-> layout-> list_view_items.xml va quyidagi kodni qo‘shing:


Ushbu bosqichda biz ListView elementlarini ko‘rsatish uchun xml faylini yaratamiz. Ushbu xml-da biz ImageView va TextView-ni ko‘rsatish uchun kodni qo‘shamiz.

android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff">

android:id="@+id/imageView"
android:layout_width="50dp"
android:layout_height="50dp"
android:padding="5dp"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:src="@drawable/ic_launcher" />

android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/activity_horizontal_margin"
android:text="Demo"
android:textColor="#000" />

Chiqish:
Endi ilovani ishga tushiring va siz ListView ro‘yxatida turli xil meva nomlariga ega bo‘lasiz. Bu erda biz ListView-da ma'lumotlarni to‘ldirish uchun Simple Adapter-dan foydalandik.

Download 1.52 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling