I want to use the same image (ImageView) in Android studio java language.

Asked 3 months ago, Updated 3 months ago, 8 views

I am creating a board game application in Android studio java language.
I want to display the same image every time I tap it, but I don't know how to do it.
The image displays the image in a position that you tap like a reverse, and the previously displayed image is
I want to create something that will not disappear.

Because it can be used up to 200 times,
I would appreciate it if the implementation could withstand that.

I don't know how to create it at all, so there is no source, but
I would appreciate it if you could tell me how to use ~.

environment:android studio 3.1.2
   Java Language

android java android-studio image

2022-09-30 11:51

1 Answers

Perhaps what user28444 needs to do is to use resource images, not ImageView.It would be great if you had two resource images inside and outside, as many ImageViews as you need for board games, for example, 64 ImageViews for Riversi, and LinearLayout for ImageViews in the right position.

Considering the ease of access, I recommend you practice with LinearLayout.As an example, in the case of Riversi, I will make the largest LinearLayout and put 8 LinearLayouts in it.Then, put 8 squares of ImageViews in each LinearLayout.Also, you can set up a touch listener for each ImageView so that the resource images on the front and back sides can be switched by tapping.

2022-09-30 11:51

If you have any answers or tips

© 2023 OneMinuteCode. All rights reserved.