У меня есть ListView, где у каждого ListItem есть TextView и RatingBar.Первоначально 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>