I'm trying to give layout_constraintDimensionRatio attribute in constraint layout different value for hdpi screens and have a default for all others. I made a dimens resource with density hdpi in values-hdpi folder. I want it to be 2:1 value for hdpi and 1:1 as default. I made a string like this <string name="layout_constraintDimensionRatio">2:1</string>
but it still takes the value from base values folder which is 1:1. Is it a problem it being a string instead of dimen?
Asked
Active
Viewed 123 times
0

Saul
- 91
- 2
- 14
-
for this, you have to create different layouts for different dpi. see this - https://developer.android.com/training/multiscreen/screensizes#TaskUseSizeQuali – Priyanka Feb 21 '20 at 11:47
-
I already have different layouts, I use 720dp but the problem is the density. I don't wanna make an entire new layout 720dp-hdpi just for one attribute. – Saul Feb 21 '20 at 11:54
-
see this link https://medium.com/@sasanksunkavalli/android-constraintlayout-layout-constraintdimensionratio-33bd2293f34c – Priyanka Feb 21 '20 at 12:06