Android: image browser for ImageView applications

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.