PercentSupportLibrary : Set percentage values in xml?

1.3k Views Asked by At

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?

2

There are 2 best solutions below

1
On BEST ANSWER

I just solved it. The values in dimens.xml will be something like this :

<resources>
    <item name="width_percent" type="dimen">60%</item>
</resources>
0
On

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>