Android Add picture naming rules

Source: Internet
Author: User

When we add images under the drawable file of Android, we often cause a series of problems due to the nonstandard image naming.


    1. When named, if the naming error, according to the system Information Invalid file name:must contain only [a-z0-9_.]

The name can be named by lowercase letters and numbers and underscores and '. ' and starts with a lowercase letter, which cannot be preceded by an underscore or a number


2.default and continue are special reserved symbols for Java, which will be translated into Java code and will appear when the image is named.

Invalid symbol: ' Default ' and other errors


3. When the image is dragged directly from the outside (named irregular image), the system will not be named incorrectly like a pop-up in the normal naming.

At this time the Android project will not error, but there will be r.id.xxx, such as the identification of the problem, because the R file does not generate the corresponding ID


4. There is also one of the most troubling point, when the 3rd situation occurs, there will be a subsequent addition of the other controls to identify the ID of the problem, so when the control ID is not recognized, you can check the drawable file in the image naming


Welcome to indicate errors or additions

This article from the "11828641" blog, reproduced please contact the author!

Android Add picture naming rules

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