Skip to content

Commit c5083cd

Browse files
scottamainAndroid (Google) Code Review
authored andcommitted
Merge "clarify dp dimension description" into froyo
2 parents ac3c1f5 + 87dfc3d commit c5083cd

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

docs/html/guide/topics/resources/more-resources.jd

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,13 @@ is specified with a number followed by a unit of measure.
216216
For example: 10px, 2in, 5sp. The following units of measure are supported by Android:</p>
217217
<dl>
218218
<dt>{@code dp}</dt>
219-
<dd>Density-independent Pixels - an abstract unit that is based on the physical density of the screen.
220-
These units are relative to a 160 dpi screen, so one dp is one pixel on a 160 dpi screen. The ratio of
221-
dp-to-pixel will change with the screen density, but not necessarily in direct proportion. The
222-
compiler accepts both "dip" and "dp", though "dp" is more consistent with "sp".</dd>
219+
<dd>Density-independent Pixels - an abstract unit that is based on the physical density of the
220+
screen. These units are relative to a 160 dpi (dots per inch) screen, so <em>{@code 160dp} is
221+
always one inch</em> regardless of the screen density. The ratio of dp-to-pixel will change with the
222+
screen density, but not necessarily in direct proportion. You should use these units when specifying
223+
view dimensions in your layout, so the UI properly scales to render at the same actual size on
224+
different screens. (The compiler accepts both "dip" and "dp", though "dp" is more consistent with
225+
"sp".)</dd>
223226
<dt>{@code sp}</dt>
224227
<dd>Scale-independent Pixels - this is like the dp unit, but it is also scaled by the user's font
225228
size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted

0 commit comments

Comments
 (0)