开发者

howto fling the Gallery as normal when having custom view with ImageView and CheckBox

开发者 https://www.devze.com 2023-04-02 22:12 出处:网络
I have an android.widget.Gallery with ImageView and a Checkbox on each Item. The user can mark images for deletion.

I have an android.widget.Gallery with ImageView and a Checkbox on each Item.

The user can mark images for deletion.

I Cannot scroll/fling when i have this custom View. Everything is loading fine and a see the images having the CheckBox ontop.

I understand that the touch event is not propagated down to the Gallery

How can i do that i read 20 discussions about this delegating touch but nothing works.

Heres my xml:

    <?xml ve开发者_Python百科rsion="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>


If someone has use for this i just figured this out myself.

Inside the getView() by removing theimageview.setOnClickListener

0

精彩评论

暂无评论...
验证码 换一张
取 消