2015-1-14/1:12

Source: Internet
Author: User

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

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.