I want to use different layout width ratios for larger tablet screens. Is there a way to set percentage based (fraction-type) values such as layout_widthPercent
and layout_marginStartPercent
in dimens.xml
?
Asked
Active
Viewed 1,348 times
4

Neoh
- 15,906
- 14
- 66
- 78
2 Answers
8
I just solved it. The values in dimens.xml
will be something like this :
<resources>
<item name="width_percent" type="dimen">60%</item>
</resources>

Neoh
- 15,906
- 14
- 66
- 78
-
How can I get this value programatically ? – theapache64 Jul 13 '20 at 15:08
1
I'm not sure if anyone else has had this problem since 2015 but, you can use a fraction tag:
<fraction name="dialog_anim_y_scale">14.285571%</fraction>

Aaron Preston
- 111
- 1
- 5