목록에있는 ratingBar의 값을 설정하는 방법을 알아 내려했지만이를 파악하지 못했습니다.Android : ListAdapter에서 ratingBar의 값을 어떻게 설정할 수 있습니까?
현재 간단한 어댑터를 사용하여 텍스트를 설정하고 있습니다.
여기에서 mylist은 해시 맵입니다.
ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.list_simple,
new String[] { "name"},
new int[] { R.id.item_title});
setListAdapter(adapter);
그리고 내 XML은
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:background="@color/white">
<TextView
style="@style/ListHeading"
android:id="@+id/item_title"
android:gravity="left"/>
<RatingBar
style="@style/RatingBarSm"
android:id="@+id/ratingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:isIndicator="true"/>
</LinearLayout>
나는 간단한 어댑터에 "등급"을 추가하려고
,이 오류가 발생합니다.ERROR/AndroidRuntime(10793): java.lang.IllegalStateException: android.widget.RatingBar is not a view that can be bounds by this SimpleAdapter
나는 이것에 유용한 것을 찾을 수 없었습니다. 어떤 도움이나 방향을 크게 주시면 감사하겠습니다.
행운이 있습니까? 아마도 맞춤 목록 어댑터가 필요할 것입니다. –
나는 똑같은 생각을하고있다. 그러나 아직 시도하지 않았다. – user401183
확장 된 simpleadapter라는 맞춤형 어댑터를 만들어야했다. – user401183