3

各 ListItem に TextView と RatingBar がある ListView があります。最初、RatingBar は非表示に設定されています。この間、onItemClickListener は適切に起動します。ただし、RatingBar の可視性を VISIBLE に設定すると、onItemClickListener は起動しません。以下を追加することで問題を解決できたチェックボックスで同様の問題を抱えている人を見てきました。

android:focusable="false"

ただし、これは RatingBar では機能していないようです。以下は、セルに使用される xml です。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ratingcelllinear" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:orientation="vertical"
    android:background="@drawable/cell_bg" android:paddingLeft="10dp"
    android:paddingBottom="3dp" android:paddingTop="3dp" android:focusable="false">
<TextView android:id="@+id/ratingcelltitle" android:text="1. First Place"
    android:layout_height="wrap_content" android:textColor="#FFFFFF"
    android:layout_width="wrap_content" android:ellipsize="end"
    android:singleLine="true" android:textSize="22dp" android:focusable="false" />
<RatingBar android:layout_width="wrap_content"
    android:layout_height="wrap_content" style="@style/AggievilleRatingBar"
    android:numStars="5" android:id="@+id/ratingcellrating"
    android:layout_weight="0" android:focusable="false" android:focusableInTouchMode="false" android:clickable="false"/>
</LinearLayout>
4

1 に答える 1

10

私は何時間も働くことを誓い、投稿するとすぐに問題を理解します.

android:isIndicator="true"
于 2011-06-10T04:03:52.080 に答える