3
我有一个ListView其中每个ListItem有一个TextView和RatingBar。最初RatingBar被设置为隐形。在这段时间内,onItemClickListener正常启动。但是,当我将RatingBar的可见性设置为可见时,onItemClickListener从不会触发。我见过的人与复选框类似的问题,能够通过增加解决他们的问题:Android ListItem 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>
这种类型的错误的准确解决方案 – 2013-04-03 09:33:43