Android basic getting started tutorial -- how to play images in 1.6. 9 (jiumei,

Source: Internet
Author: User

Android basic getting started tutorial -- how to play images in 1.6. 9 (jiumei,
Basic tutorial on Android-1.6 (jiumei)

Tags (separated by spaces): basic Android tutorial

1. This section introduces:

There may be some questions:

1. What is. 9 image?
A: The image is suffixed with a name of .9, such as pic1.9.png.

2. 9 What Can images do?
A: When the image is stretched, the image will not be distorted in the specific area, but the actual area can be drawn by ourselves.
3. 9 What are images used?
A: To do things well, you must first sharpen the tool. 9. The tools for making images are as follows:

Android SDK comes with draw9patch. batBut Google hasn't updated it for a long time...

NinePatchEditorCompared with its own, it has made some optimizations and supports batch operations, and the interface looks better:
If you are interested, you can download this file, which I usually use. Download link:

NinePng, Mobile version. 9. The processing tool is still awesome, but it is a little troublesome to connect to wifi to transfer images. The function is still quite powerful. If you are interested in searching and downloading the related app market:

PhotoShopThis is an exaggeration. Generally, the. 9 diagram is made by an artist. If you are interested, you can search for relevant tutorials!

2. 9. How do I create images?

!! Key points: stretch to the upper left and lower right !!!!!!
In fact, the core is the above content! Find an image first!

1. Create a. 9 graph instance using draw9patch. bat:

There is an image like this: we can use the android: blackground of TextView to set it as a background of TextView. When there is a small amount of content, it is still normal. The following situation may occur when there are more than one image:
We can see that the image is stretched and deformed. Obviously, this is not what we need, so we need to process this image so that the rounded corner does not stretch with length, and the middle part is stretched.

Open draw9patch. bat and click File in the upper left corner to open the image material to be processed in the corresponding directory,
Next we can see the main interface of our tool:

The preview areas on the right are vertical, horizontal, and horizontal.

Okay. Now we start to process the image:

Step 1.Adjust Zoom and Patch scale: set the appropriate scaling ratio, and select show patch.
Make Zoom large enough, because we need to deal with the "zebra line" later"

Step 2.Next, we only need to operate on the zebra crossing:
PS: the black line comes out one by one. If you want to remove the point, press shift!

Step 3.Save the image, ending with .9.png
For example, the saved file name is back.9.png;
Hey, then add him to our project and set it as the background of TextView:

The results are shown in the figure no matter how long the characters are displayed. New skills get ~

2. See how others do it. 9. figure:

We may need to make different. 9 diagrams based on different situations. Here are some examples of some of the. 9 diagrams that are slightly complicated by others!

1. Link to the original article:! This is a good reference. No Qaq is available!

2. Original article link:

3. Original article link:

3. Summary in this section:

All right, this section will show you how to create a picture that can be stretched. 9. It's still relatively simple. Remember our tips: stretch on the top left and stretch on the bottom right!
After creating a few. 9 pictures, I believe you will have a deep understanding. Goodbye ~

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

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: 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.