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.