I am trying to create a layout suitable for HDPI scree of size 4" and 5.99". But I tried using density qualifier but it did not work as the things would go out of the layout in 4 or seem small in 5 inch screen. How can I avoid it?
CodePudding user response:
I had faced this issue before and I suggest you to use sdp
and ssp
instead of dp
and sp
.
You'll have to add dependency
in your gradle script
For ssp
implementation 'com.intuit.ssp:ssp-android:1.1.0'
For sdp
implementation 'com.intuit.sdp:sdp-android:1.1.0'
Note :Do not use wrap_content
for images
and buttons
while using sdp. If you do, when running in small device, the system will wrap up the image without considering the size of the screen. So use specific sdp
for images and buttons.
For tablets, consider creating different layout and for landscape mode in phone, if its not necessary disable the option, or create new layout.
If you want to learn more about ssp
and sdp
for ssp
for sdp