사용자가 가입 또는 가입을 취소 할 수있는 큐 집합이 포함 된 사용자 지정 ListView가 필요합니다. 내 listview의 각 항목은 TextView 및 스위치가 포함 된 RelativeLayout으로 구성되어야합니다. 이 목록을 채우려면 어떻게해야합니까? .각 항목의 Switch 및 TextView가있는 사용자 지정 ListView
I는 각각의 JSON 오브젝트가이 사용자가 대기열에 등록되었는지 여부의 이름 및 문자열 값 (갖는다 JSON 오브젝트의 배열을 가지고
qInfo [I]는 (.optString "이름"은) 내 텍스트 뷰의 텍스트를 설정해야합니다
qInfo [내가] ("값을".optString) 내 스위치의 상태를 설정해야합니다
queues_item을.. :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/queuesLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/queues_item_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Switch
android:id="@+id/queues_item_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:textOn="Tilmeldt"
android:textOff="Frameldt"/>
</RelativeLayout>