Android css font-size vw vh responsive alternative

巧了我就是萌 提交于 2020-02-24 20:15:06

问题


Is there alternative on android? I know that i can create style file for each screen density and size and change font size there.

But providing single relative/auto scalable value, like it does in css would be awesome.

I'm surprised that android doesn't have it, as well as svg drawables support only in latest api...

Thank you.


回答1:


VW should work with percentages. VH won't work. The only solution i came up with, is to write a JS for this. Just measure the VH and if Android use the calculated pixels instead of VH.

Playing with percentages, calc, etc. didn't solve it for me.



来源:https://stackoverflow.com/questions/27602691/android-css-font-size-vw-vh-responsive-alternative

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!