我们正在使用 Titanium 为 android、ios 和移动网络开发应用程序。我们想更改文本的字体,它在模拟器上的 android、ios、移动网络上工作正常。但是,如果您在浏览器(即 firefox)上打开该文件,则该字体不起作用。
有更改字体的代码:
"TextField": {
height : 40,
color : "#000000",
returnKeyType : Titanium.UI.RETURNKEY_DONE,
backgroundFocusedColor : "transparent",
font: {
fontSize : 16,
fontFamily : "OpenSans-Regular"
}
}
当你检查 firebug 时,它会显示如下内容:
@font-face {
font-family: "mobileweb\F ontsOpenSans-Regular";
src: url("mobileweb\F ontsOpenSans-Regular.ttf,mobileweb\F ontsOpenSans-Regular.woff");
}
这显然行不通,因为字体系列显示的是地址而不是字体名称。我在网上搜索,看看他们是否有解决方案,但他们找不到。
也许这是一个错误,但我想知道你们是否有解决方法。
非常感谢您的帮助。谢谢!
最佳答案
您需要将文本值设置在“font: {}”部分的上方或下方。
text: " text in here will show up in your code "
顺便说一句,这对我的应用程序也有帮助,字体只是不想更改默认值。 所以谢谢你的帮助!! :-)
关于javascript - Titanium mobileweb 字体无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22603697/