My android learning experience 9 and android learning experience 9

Source: Internet
Author: User

My android learning experience 9 and android learning experience 9

Add a background image to the android activity

1.you can download images of Android on the Internet or create images in the png format. (Note that the image size should be suitable for your mobile phone screen or AVD screen. You can download the corresponding images or make them by yourself)

2. Add the image prepared in step 1 to the drawable-hdpi folder in the res folder of the project. You can add the image in either of the following ways:

(1) You can open the drawable-hdpi folder in the res folder of the corresponding project in your work interval and add the png Image to it.

(2) drag the image directly to the drawable-hdpi folder in eclipse.

3. Open the layout file (xml file in the layout folder under the res folder) and write the following code in the layout.

Android: background = "@ drawable/p1" p1 is the image name

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.