e.g.
My Project
- res/
- layout/ ==> default portrait
main.xml
- layout-land ==> landscape
main.xml
- layout-large/ ==> large portrait
main.xml
- layout-large-land ==> large landscape
main.xml
The file names must be exactly the same, but their contents are different in order to provide an optimized UI for the corresponding screen size.
Providing bitmap resources that are properly scaled to each of generalized densities: low, medium, high, etc. will help to achieve good graphical quality and performance on all screen densities.
To generate images, start with raw resources in vector format and generate the images for each density using the following size scales:
- xxxhdpi: 4.0
- xxhdpi: 3.0
- xhdpi: 2.0
- hdpi: 1.5
- mdpi: 1.0 (baseline)
- ldpi: 0.75
If we generate a 200x200 image for xhdpi, we should generate the same resources in 150x150 for hdpi, 100x100 for mdpi, 300x300 for xxhdpi and then place them in the appropriate drawable resource directory:
e.g.
My Project
- res/
- drawable-xxhdpi/
example.png
- drawable-xhdpi
example.png
- drawable-hdpi/
example.png
- drawable-mdpi
example.png
- drawable-xxhdpi/
example.png
- drawable-xhdpi
example.png
- drawable-hdpi/
example.png
- drawable-mdpi
example.png
댓글 없음:
댓글 쓰기