Using a UIWebView, can I use a custom font?(使用 UIWebView,我可以使用自定义字体吗?)
问题描述
我在网上看到了所有关于在 iPhone OS 中使用自定义字体的困难的讨论.是否可以将我的包中的字体加载到 UIWebView 组件中?
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?
我在Rusty Brick"的名为Omer"的应用程序中看到它......这似乎是一个网络视图,因为我看到了延迟,并且在加载延迟期间,自定义区域是白色的.这可能是什么其他组件?
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?
我联系了 Rusty Brick.他们告诉我它是哪种字体.标准字体.
I contacted Rusty Brick. They told me which font it was. A standard font.
推荐答案
iOS3.2及以上的UIWebView可以加载自定义字体.将字体添加到您的捆绑包中(请参阅 在这里) 然后像引用任何其他字体一样引用 UIWebView 样式表中的字体:
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,我可以使用自定义字体吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 UIWebView,我可以使用自定义字体吗?
基础教程推荐
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
