1. display images only:
Introduction:
When you are doing this, you need to import the image in the source program.
Readers should note that all images can only be named.
< p>
< p>
The code with a yellow background is added to show the picture cyclically.
All code:
MainActivity [] images = currentImg = 0 ImageView imageView = 0 imageView. setImageResource (images [++ currentImg %View CodeView Code
2. Use other controls to control images:
Key code:
next.setOnClickListener( ++currentImg%="deprecation" (v ==+= 20(alpha >=255=255 (v==-= 20(alpha <= 0= 0
In short: add control over the ImageView attribute in the listener.
All code:
MainActivity [] images = currentImg = 0 alpha = 255 ImageView image1 = Button plus = Button minus = Button next = next. setOnClickListener (++ currentImg % = "deprecation" (v = + = 20 (alpha> = 255 = 255 (v =-= 20 (alpha <= 0 = 0View CodeView Code