Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final ImageView iv_YourImage = (ImageView) findViewById(R.id.iv_imageview);
- public boolean onTouch(View v, MotionEvent event){
- int topParam = iv_YourImage.getPaddingTop();
- int rightParam = iv_YourImage.getPaddingRight();
- int maxTopParam = topParam+iv_YourImage.getMaxHeight();
- int maxRightParam = rightParam + iv_YourImage.getMaxWidth();
- if(event.getX>topParam&&event.getX<maxTopParam){
- //the x coordinate is in your image... do the same to Y
- }
- return true;
- }
Add Comment
Please, Sign In to add comment