Android stretched Pictures

Source: Internet
Author: User

Android stretched pictures with a 9.png format picture, this picture can specify the part of the image stretching, that part of the display, the artist gives a small picture can also have a good display effect.

The original background picture can see the original background image is very small, even in the longer text, the background image of the fillet will not stretch

Making ###.9.png

Open Android Sdk>tools>draw9patch.bat, drag the picture and start making ###.9.png

Click four weeks to add black dots and drag black dots to line up. The black and black dots around the picture have different meanings.

The upper black line or dot indicates a vertical stretch of the area generally a point can be

The left black line or dot indicates a horizontal stretch of the area generally a point can be

The following indicates that areas of vertical fill are usually a black line

On the right, the area where the content is horizontally filled is usually a black line.

1 <Relativelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"2 Xmlns:tools= "Http://schemas.android.com/tools"Android:layout_width= "Match_parent"3 Android:layout_height= "Match_parent"Android:paddingleft= "@dimen/activity_horizontal_margin"4 Android:paddingright= "@dimen/activity_horizontal_margin"5 Android:paddingtop= "@dimen/activity_vertical_margin"6 Android:background= "@android: Color/darker_gray"7 Android:paddingbottom= "@dimen/activity_vertical_margin"Tools:context=". Mainactivity ">8 9     <TextViewAndroid:text= "@string/hello_world"Ten Android:layout_width= "Wrap_content" One Android:layout_height= "Wrap_content" A android:gravity= "Center_vertical" - Android:background= "@drawable/bg"/> -  the </Relativelayout>

Ok

Run the program

Note: the black dot on the left is not coincident with the gap on the right, otherwise the right side will be stretched.

Android stretched Pictures

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.