Limit the click area on the view android

I need to limit the click area on the view. For example, I have a full-screen view, but I need only the top of the screen to be clickable, while clicking on the bottom should not give a result, how can I implement this? adding on top of the container doesn't help

Upvotes: 0

Views: 68

Answers (1)

Booger
Booger

Reputation: 18725

You will need to create a click listener ONLY on the view you want to respond.

TopView.setOnClickListener()

BottonView (nothing).

If for some reason, your top View is not independent, just create another view that is transparent, and set a clickListener on that.

Upvotes: 3

Related Questions