All the UIS of the Android client, androidui

Source: Internet
Author: User

All the UIS of the Android client, androidui

Click to download]




How to Design the android ui

There are many examples of ApiDemo In the SDK, which can provide you with a lot of inspiration.

Android UI development, for dip and px Problems

First, I would like to say that dip is not the pixel density, but the pixel density is dpi.
Dip: device independent pixels (device independent pixel ). different devices have different display effects, which are related to the hardware of the device. We recommend that you use this function to support WVGA, HVGA, and QVGA without pixels.

Well, let's get to the point. Let's talk about px first. px is a pixel. If px is used, it will be drawn using the actual pixel. For example, draw a horizontal line with a length of px, in a 480-width simulator, the screen width is half the screen width, and in a 320-width simulator, the screen width is 2/3.

Dip is to divide the screen's high score into 480 points and the width into 320 points. For example, if you build a 320 dip horizontal line, whether you are on a 480 or simulator, it is half the screen length.

So your problem is solved:
Question 1:
Why is the unit px and dip written in the Code the same as that in the simulator? It's not about dip! = Px?

A: If the width of your simulator is 320 pixels, 100dip is the same as 100px.
Question 2:
Why is the running result length inconsistent between simulator 1 and simulator 2? It seems that the length of simulator 1 is a little longer (because simulator 1 shows 512 in full)
A: The width and height of the two simulators are different, so the dip display is different.

I don't know. I don't understand LZ. I have poor expression skills, but this is the case. I have been using the UI for half a year.

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.