国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

android-studio - Why android:clickable="true" cannot trigger click events in the item layout of RecyclerView?
曾經(jīng)蠟筆沒有小新
曾經(jīng)蠟筆沒有小新 2017-06-06 09:52:55
0
2
1184

Why can't android:clickable="true" trigger a click event in the item layout of RecyclerView?
The original code is like this:

<TextView
        android:id="@+id/city_name"
        android:layout_width="match_parent"
        android:layout_height="70dp"
        android:background="?android:attr/selectableItemBackground"
        android:clickable="true"
        android:gravity="center_vertical"
        android:padding="16dp"
        android:text=" 新都市 "
        android:textColor="#666666"
        android:textSize="14sp"/>

I found that when clicking, there was only a ripple effect but the click event could not be triggered. Later, I changed android:clickable="true" to false, and the rest remained unchanged, but there was a ripple effect and a click event. Why is this?

曾經(jīng)蠟筆沒有小新
曾經(jīng)蠟筆沒有小新

reply all(2)
巴扎黑

What event do you want? Whose response is your incident? TextView click, or RecyclerView Item click? These are two concepts.

過去多啦不再A夢

If you bind the click event to the item, when the clickable of TextView is true, it will consume the entire event sequence and cannot trigger the click callback of the item

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template