Blinking issue when changing image in ImageView

Asked 2 years ago, Updated 2 years ago, 22 views

Hello, everyone You can attach a touch event to the current image view You want to change the image in the image view when you move it by hand.

There are nearly 20 images. (Moving coordinates/image) I'm calculating and changing it.

If you move slowly, the image changes, but it's unnatural because it blinks If you move fast, the 0th to 20th images suddenly appear...

In summary,

I used Image View and Image Switch I used the image switch with the library because it was too heavy This eliminates the switch's unique functionality.crying My head hurts so much... If you throw me anything that could be a hint, I'll test it.

android

2022-09-21 16:42

2 Answers

Learn about image caching. Try Glide.


2022-09-21 16:42

I don't know if I understand well, but if you want to move the image view along your fingers, search with viewDragHelper. If you touch the touch event yourself, no matter how careful you are, your image will tremble with shaking hands. The helper provided by android provides a threshold for shaking, allowing you to move the view smoothly~


2022-09-21 16:42

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.