有没有办法可以在WebView中使用Apple San Francisco? [英] Is there a way I can use the Apple San Francisco in a WebView?

查看:95
本文介绍了有没有办法可以在WebView中使用Apple San Francisco?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的CSS样式表似乎工作正常,但是我无法将字体更改为与iOS 11中使用的系统字体紧密匹配的字体.这是我尝试过的方法:

My CSS style sheet appears to be working fine but I'm not able to change the font to one that closely matches the System font used in iOS 11. Here is what I tried:

body, html {
    color: red;
    font-family: 'San Francisco';
};

字符颜色为红色,但字体不变.

The characters color is Red but font doesn't change.

如何在Xamarin.Forms iOS中指定与Apple System字体非常相似的字体?

How can I specify a font that closely resembles the Apple System Font in my Xamarin.Forms iOS?

推荐答案

可以通过以下方式检索系统字体系列名称:

The system font family name can be retrieved via:

UIFont.PreferredBody.FamilyName

在iOS 11上是:

.SF UI Text

老学校:

<font face='.SF UI Text'>This is the iOS System Font: San Francisco</font>

HTML/CSS:

<!DOCTYPE html>
<html>
    <head>
            <style type='text/css'>
                body { 
                    font-family: '.SF UI Text';
                    font-size: 60pt;
                }
            </style>
     </head>
<body>
This is the iOS System Font: San Francisco
</body>
</html>

这篇关于有没有办法可以在WebView中使用Apple San Francisco?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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