Android的CSS字体大小VW VH替代响应 [英] Android css font-size vw vh responsive alternative

查看:459
本文介绍了Android的CSS字体大小VW VH替代响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有在Android上的选择吗?我知道我可以为每个屏幕密度和大小创建样式文件,改变字体大小那里。

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

但提供相对单一/自动可伸缩的价值,就像它在CSS将是真棒。

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

我很惊讶,Android不拥有它,以及SVG可绘制仅支持最新的API ...

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

感谢您。

推荐答案

VW应与百分比的工作。 VH将无法工作。我想出了唯一的解决办法,就是写这个JS。只是衡量VH,如果Android的使用,而不是VH计算的像素。

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.

这篇关于Android的CSS字体大小VW VH替代响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆