Skip to content

Density Independent Pixels / TranslationZ

Compare
Choose a tag to compare
@berardo berardo released this 29 Dec 12:32
· 14 commits to master since this release
  1. BugFix: Integer directive not rendering on iOS.
  2. Density independent pixels: Now you no longer have to worry about providing the correct values for pixel related attributes based on the device's screen density. Since iPhone 6S, each point correspond to 9 device pixels (3 horizontally x 3 vertically - that's the reason behind the @3x images - view more here). The same happens to Android where the benchmark (mdpi) is considered ~160 pixels (or dots) per inch (dpi) and the majority of the modern devices having way denser screens, reaching ~640dpi or more. Find out more here.
  3. New Android specific attribute called translationZ. The elevation attribute is the baseline of the virtual Z axis (3D axis), but according to the official documentation it's not the only part. Then, translationZ will add extra distance to the surface and it's mainly used for animations.