2011-06-09 8 views
3

各ListItemにTextViewとRatingBarがあるListViewがあります。最初は、RatingBarは不可視に設定されています。この間、onItemClickListenerは正常に起動します。しかし、RatingBarの可視性をVISIBLEに設定すると、onItemClickListenerは決して起動しません。しかし、これはRatingBarのために動作していないようですAndroid ListItemは、評価バーが表示されているときにonItemClickListenerを起動しません。

android:focusable="false" 

:私は追加することによって、彼らの問題を解決することができましたチェックボックスと同様の問題を持つ人々を見てきました。下のセルに使用される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> 

答えて

10

私はできるだけ早く私は問題を把握ポストとして時間を仕事と誓います。

android:isIndicator="true" 
+0

このタイプのバグに対する正確な解決策 –

関連する問題