You may have noticed that many Titanium examples on the web will often use px (pixel) values, whereas others use dp (density-independent pixels ) instead. There is a significant difference between the two values which is important to understand whenever putting together a cross-platform application.
px: This unit corresponds to the actual pixels on the screen. In the case of the iPhone, for example, this value is 320 x 480 px.
dp: This unit corresponds to the physical density of the screen. The scale of dips to pixels is not always proportionate between devices, and is definitely not proportionate between platforms. On iOS, 1 px equals 2 dp. This is how iOS retina images work, by always being twice the density of the equivalent area in pixels.
On iOS, you can use either pixels or dps—they are treated in the same way. To implement both normal and retina images on the iPhone or iPad is a simple case of creating two separate images—one in the native pixel resolution...