After 4.0, a new Android project will automatically generate drawable,drawalbe-ldpi,drawable-mdpi,drawable-hdpi,drawable-xhdpi,drawable-xxhdpi six folders, In addition to Drawable, the
types in the drawable package) allow you to use public methods to define various attributes of drawable. some attributes you want to adjust may have alpha transparency, color consideration, jitter, opacity and color.
You can also use XML to define the original drawable shape. For more information, see the shapedrawables section in the
First, Knowledge introduction①res resource picture is a resource picture placed under the project res file②bitmap Bitmap, the general file suffix is BMP, need encoder coding, such as rgb565,rgb8888. A pixel-wise display object with high execution efficiency, but with obvious drawbacks and low storage efficiency.③drawable, a general-purpose graphical object that can load commonly used images, gif,png,jpg, also supports BMP, providing some advanced visu
1. How to Create a bitmapdrawable object
Bitmap represents a bitmap image. Android supports bitmap images in three formats:. PNG (preferred}.jpg (acceptable) and. GIF (discouraged ).
The secondary node has the worst support.
You can directly use the image name as the resource ID to directly reference a bitmap image. You can also create a resource alias ID in the XML file.
When building an application, bitmap files may be automatically compressed by th
I. Official download cocos2d-2.1beta3-x-2.1.1.rar, unzip, such as cocos2d-2.1beta3-x-2.1.1/
II.
Unzip the folder to see if the cocos2d-2.1beta3-x-2.1.1 owner is the current user, and whether the operation permissions can be read and written.
If not, use either of the following methodsMethod 1 (recommended ).
Owner changeProperty-> Security-> advanced-> ower-> edit-> OK
Permission changeProperty-> Security-> edit-> (everyone or your account) full cont
according to the screen resolution.If android:anydensity= "false"The application supports different densities, and the system automatically scales the image size and coordinates of the image. Explain how the system automatically scales resources.For example, if we have the same resource under the Hdpi,mdpi,ldpi folder, then the application will not automatically go to the appropriate folder to find resourc
In the process of Android development, we often need to change the style of the control, can be used to add a background image of the way to change, but the background image is more and more certainly will make the apk file very large.We can do this with our own definition of the attribute shape.Shapegradient--the corresponding color gradient.StartColor, EndColor will not say much. android:angle refers to the angle from which the change begins. Solid
Reprint Please specify source: http://blog.csdn.net/bbld_/article/details/40584331Here are a few drawables features to help you implement material design in your app:L can draw coloringL Highlight the color extractionL Vector-able-to-paintThis section shows you how to use these features in your app.Hue drawable ResourcesIf you use the system version above Android5.0 (API level 21), you can colorize bitmaps and 9patch graphs as transparency masks. You
android-canvasdrawablea CanvasCanvas: CanvasesUsed to render graphics on the screen, known as the canvasTwo introduction to canvasCommon classes1 Clip: Clipping area2 matrix: matricesDivide the canvas into many squaresThe rotation method is the canvas rotation3 Save: Saves the state of the canvasRestore: Restoring the state of the canvasFor example, rotate the canvas after painting the other content, save after recovery,Common Draw methods:Drawrectl:
The Res directory is primarily a resource file!Layout layouts This is what you often see with the user interface of the XML file, is the arrangement of each view and nested, nothing to say the style and theme, style is mainly refers to the display style of the view;Place the image file in the res/raw/directory, which avoids being automatically optimized.Values are some constant XML files set by the program staff, which are easy to modify and use, generally have strings,colors and so on.Assets
I have just read a simple Android example of the next frame layout. After a long time, I don't know how to add the image to the drawable in the resource.For example, how to add a new image resource in the Res/drawable folder of testdemo.
Copy the image to bin \ res \ drawable
Android will export the jar into the Android dependencies and Android Private libraries two kinds, The goal is for developers to choose, but in general these two must be scored apk! second, the package of the project
This package includes the project's class package, as well as the creation of a variety of tool class packages; the various packages
1.SRC: Store all the *.java source programs.2.gen: Save path for automatically generated code file for ADT plug-in, R.java will save all resource IDs.3.assets: Can hold the project some large resource files, such as: pictures, music, fonts and so on.4.res: Can store all the resource files in the project, for example: Pictures (*.png, *.jpg), text, etc.5.RES/DRAWABLE-HDPI: Save a high-resolution picture resource, you can use Resources.getdrawable (ID)
For drawable, Layout, menu folder each file will be generated in the R.java file drawable, layout, menu Class A constant, the class name is the name of the folder, the constant name is the file name.For the values folder below the file is generated according to the contents
activity and one specialized ContentProvider. Android uses the next activity tag to fill in the list of available activity folders. In the following example, we will use the Android built-in ContentProvider: Contacts Contact to implement an active folder for Contacts.First, let's look at the description file: AndroidManifest. xml.[Java]Package = "com. test. live
() {//These parameters have default values and are not set.//Setselectorfiletitle ("This is file title"); //Setselectorfoldertitle ("This is the folder title"); //Setselectorfileicon (R.drawable.ic_fileselect_file); //Setselectorfoldericon (R.drawable.ic_fileselect_folder); //Setselectoriconheight (150); //setselectoriconwidth ();}} @Override Public voidonbackpressed () {Super. onbackpressed (); } @Override Public voidonclickokbtn () {Super. ONCLICKO
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.