약간의 문제가 있습니다. 나는 ListView가 있고 나는 다음을 사용한다 :ListView에서 라디오 버튼의 위치를 변경하십시오.
ArrayAdapter adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_single_choice,
data);
단일 선택 목록을 가지고있다. 하지만이 솔루션에서는 오른쪽에 라디오 버튼이 있지만 왼쪽에 넣고 싶습니다. 어떻게해야합니까?
편집 : 내 XML 파일 :
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
android:layout_weight="92.5">
<TextView
android:id="@+id/user_account_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="109dp"
android:text="@string/user_account_text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ListView
android:id="@+id/user_account"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:scrollbars="vertical"
android:layout_marginRight="100dp"
android:layout_weight="1"
android:layout_marginLeft="100dp">
</ListView>
<Button
android:id="@+id/login_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_gravity="center"
android:text="@string/login"
android:background="@drawable/button"
android:textColor="@android:color/white"/>
</LinearLayout>
당신은 사용자 정의 어댑터를 사용하여 레이아웃 XML 파일 – chancea
을 게시하고 사용자 정의 팽창 수 체크 박스 또는 라디오 버튼이있는 레이아웃. 사용자 정의 레이아웃을 정의 할 수 있습니다. – Raghunandan