android imageview onClick animation

后端 未结 4 1646
生来不讨喜
生来不讨喜 2021-01-30 17:24

I guess this is kind of an odd question but I have tried setting onClicklistener on an ImageView and it has worked. But the problem is that the user cannot sense the click. I me

4条回答
  •  执笔经年
    2021-01-30 18:14

       
    
    
    
    
    
    
    
    

    I don't know if this is the correct method but defining an animation as mentioned did the trick. Now we just have to give

    public void onClick(View v) {
    v.startAnimation(AnimationUtils.loadAnimation(Context, R.anim.image_click));
    //Your other coding if present
    }
    

    in the OnClick method and the change will be visible...

提交回复
热议问题