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

查看:29
本文介绍了有没有办法在 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 系统字体非常相似的字体?

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 上是:

And on iOS 11 it is:

.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天全站免登陆