Gio
Gio

Reputation: 1954

Remove clickability from ImageView

I have a ListView and I want it to have shadows at top and bottom. For this I overlay two ImageView-s that contain the shadow images. Problem is, they receive touch events and ListView isn't scrolled when you try to start scrolling from top or bottom. I've tried setting enabled,focusable,clickable and longClickable properties to false, but that doesn't seem to do the trick. Any help would be much appreciated.

Upvotes: 0

Views: 986

Answers (3)

Oibaf it
Oibaf it

Reputation: 1952

You can't set Image of the shadow as background of the listView? Try something like this:

<ListView
...
android:backgroung="@drawable/shadow" 
android:cacheColorHint="#00000000" 
>
...
</ListView>

Upvotes: 0

knvarma
knvarma

Reputation: 974

setting the imageview focusable="false" and set clickable="false" should work

Upvotes: 2

Ramindu Weeraman
Ramindu Weeraman

Reputation: 354

You can use listView.setClickable(false)

Upvotes: 1

Related Questions