android change image onclick imageviev

后端 未结 2 1019
名媛妹妹
名媛妹妹 2021-01-28 12:13

How can I change Image of an Imageview?

I want to get the image associated; if it is img1 I want set the image to img2, if it is <

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-28 12:47

    I think you are looking for ImageView.setTag() and ImageView.getTag().It checks if the image is associated with the Image view as @ρяσѕρєя K mentioned in comment.

    There are two version of setTag one which takes object as an argument and other takes key and object as an argument

提交回复
热议问题