使用UIWebView,我可以使用自定义字体吗? [英] Using a UIWebView, can I use a custom font?

查看:171
本文介绍了使用UIWebView,我可以使用自定义字体吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在网上看到了在iPhone OS中使用自定义字体的困难。编辑:我看到它在生锈的砖称为奥马尔的应用程序。它可以从我的包中加载一个字体到UIWebView组件吗?

..这似乎是一个网络视图,因为我看到一个延迟,在加载延迟期间,自定义区域是白色的。还有什么其他的组件?



编辑2:我联系了Rusty Brick。他们告诉我这是什么字体。一个标准的字体。

解决方案

可以在iOS3.2及以上版本的UIWebView中加载自定义字体。将字体添加到您的包(请参阅这里),那么只需在您的UIWebView的样式表中引用字体,就像您使用其他任何字体一样:

 <样式类型='text / css'> font {font-family:DroidSerif; }< / style> 


I've seen all the talk on the web about the difficulty of using a custom font in iPhone OS. Is it possible, to load a font from within my bundle into the UIWebView component?

EDIT: I saw it in the app called "Omer" by "Rusty Brick"... It seems to be a web view, because I see a delay and during the loading delay the custom area is white. What other component could this have been?

EDIT2: I contacted Rusty Brick. They told me which font it was. A standard font.

解决方案

It is possible to load custom fonts into your UIWebView in iOS3.2 and above. Add the font to your bundle (see here) then just reference the font in your UIWebView's stylesheet like you would any other font:

<style type='text/css'>font { font-family: DroidSerif; } </style>

这篇关于使用UIWebView,我可以使用自定义字体吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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