Friday, February 14, 2014

Android fit different screen sizes


If an application to fit the resolution ldpi, mdpi, hdpi, xhdpi, xxhdpi and the size of small, normal, large, xlarge, is not to write 20 sets of layout files? There is no simpler way == ... I have used the relative layout and "wrap_content" and "match_parent".<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Unless special circumstances need not only need one for each screen layout for each file
Usually there are three sets of pictures on it, other conditions can be applied.

Reply:
cited a floor birdsaction reply:
not need unless special circumstances require one for each screen layout for each file
Usually there are three sets of pictures on it, other conditions can be applied.


dips = pixels / (density/160), the density of the same screen size of different mobile phones, dips are also different, is not necessary to set a different dips layout file?
Reply:
dp is device-independent, but according to the screen size and screen density, different width and height of the phone there are so many dp, in the end what is nothing to do with the device?
Reply:
Therefore, the general layout of the write layout are relative, his effect on the size will change as the tour's relative position within the control of the same layout and HTML5, of course, some of the more abnormal (complex) still need to write a set of layouts for different screen layouts
Reply:
references, 4th Floor Lucifd_CH reply:
so generally write layout are relative layout, his effect on and HTML5 will change as the tour's size within the layout the same relative position of the control, of course, some of the more abnormal (complex) still need to write a set of layouts for different screen layouts


If you write the layout of the document, a control at the top, height 50dp, b in a space below to fill all the space below, supposed to?
Reply:
references, 5th Floor wjqwei reply:
Quote: references to the 4th floor Lucifd_CH reply:

Therefore, the general layout of the write layout are relative, his effect on the size will change as the tour's relative position within the control of the same layout and HTML5, of course, some of the more abnormal (complex) still need to write a set of layouts for different screen layouts


If you write the layout of the document, a control at the top, height 50dp, b in a space below to fill all the space below, supposed to?


If you write the layout of the document, a control at the top, height 50dp, controls b in a following to fill all the space below, supposed to?
Reply:
Lucifd_CH and birdsaction
I understand, I also used the relative layout is not good enough, then think biased, in fact, I do not think so complicated, thank you friends ~
Reply:
Our approach is to set
in AndroidManifest.xml<-! Screen adaptation ->
android: anyDensity = "true"
android: largeScreens = "true"
android: normalScreens = "true"
android: resizeable = "true"
android: smallScreens = "true" /> Then each resolution will cut a figure on the line
Reply:
Results posted landlord does not give points
Reply:
. getWindowManager () getDefaultDisplay () getWidth ();.
. getWindowManager () getDefaultDisplay () getHeight ();.
You can get a variety of screen resolution

No comments:

Post a Comment