Transduction
1. If you just cut a set of pictures, then is cut 800*480, in addition to the application of the navigation page will appear stretching effect, other places will not have very obvious stretching and zooming effect, so this time need to separate the navigation page picture.
2. If it is cut two sets of pictures, a set of 800*480, another set of 1280*720.
When there is no image in the drawable directory that corresponds to the resolution of the phone, it will automatically load high-resolution images instead of loading low-resolution images.
Although it is recommended to use DP, but DP is not able to achieve the adaptation effect, we need to calculate the PX and DP at different resolutions of the conversion ratio.
Dimens adaptation of the wording:
Create a new values-1280x720 in the Res directory: (a horizontal, between the numbers is the English letter x, cannot be written as multiplication sign), does not specify the resolution, will load the default values folder under the Dimens size.
ldpi:320x240 120dpi 1DP = 0.75px
mdp:480x320 160dpi 1DP = 1px
hdpi:800x480 240dpi 1DP = 1.5px
xhdpi:1280x720 320dpi 1DP = 2px
xxhdpi:1920x1080 480dpi 1DP = 3px
Advantages of using library files with respect to jar packages:
The code in the library file can be changed according to our specific requirements, but the jar package cannot be modified.
Fragment in the general implementation of the 3 life cycle method can be: OnCreate (), Oncreateview (), onactivitycreated (),
Oncreateview () is equivalent to Setcontentview () in the activity, and the loading layout is implemented on this page.
Show Subclass Name: This.getclass (). Getsimplename ();
After getting to the fragment object, replace the layout file of the original page with fragment:
Getactivity (). Getsupportfragmentmanager (). BeginTransaction (page replaced, Fragment,tag). commit ();
2015-1-14/1:12