PercentSupportLibrary: set percentage values ​​in xml?

I want to use different layout width ratios for large tablet screens. Is there a way to set interest (fractional) values, such as layout_widthPercentand layout_marginStartPercentin dimens.xml?

+4
source share
2 answers

I just decided. The values ​​in dimens.xmlwill be something like this:

<resources>
    <item name="width_percent" type="dimen">60%</item>
</resources>
+8
source

I'm not sure if anyone else has encountered this problem since 2015, but you can use the fraction tag:

    <fraction name="dialog_anim_y_scale">14.285571%</fraction>
0
source

All Articles