ImageViewとチェックボックスを使用してカスタムビューを持っているときに、通常どおりギャラリーを逃げる方法
-
26-10-2019 - |
質問
を持っています android.widget.Gallery
と ImageView
そしてa Checkbox
各アイテムに。
ユーザーは削除のために画像をマークできます。
このカスタムがあるとき、私はスクロール/逃げられません View
。すべてがうまくロードされており、 CheckBox
オントップ。
タッチイベントが広まっていないことを理解しています Gallery
どうすればいいのか、この委任されたタッチについて20の議論を読んだが、何もうまくいきません。
ここに私のXML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="false"
android:focusable="false"
>
<ImageView android:id="@+id/thumbImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:clickable="false"
android:focusable="false"
/>
<CheckBox android:id="@+id/itemCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:clickable="false"
/>
</RelativeLayout>
解決
誰かがこれに使用しているなら、私はこれを自分で理解しました。
内側 getView()
削除することによって theimageview.setOnClickListener
所属していません StackOverflow