[英]Font Awesome icons not rendering in Phonegap iOS application
而不是渲染圖標我得到小方塊:
它在瀏覽器中運行得非常好,但是當我在iOS模擬器或移動Safari中查看我的應用程序時,正方形就在那里。
非常感謝你的幫助!
我遇到過同樣的問題。 我將“font-awesome.min.css”文件直接放在我的cordova ios xcode中,而不是在“index.html”文件中調用它,其中:
<link rel="stylesheet" href="css/font-awesome.min.css">
之后我嘗試使用字體awesome spinner而不是默認的jQuery Modile預加載器,在jQuery Mobile調用之前甚至在“index.html”中使用此代碼:
<script>
$(document).bind( 'mobileinit', function(){
$.mobile.loader.prototype.options.text = "loading";
$.mobile.loader.prototype.options.textVisible = true;
$.mobile.loader.prototype.options.theme = "p";
$.mobile.loader.prototype.options.textonly = false;
$.mobile.loader.prototype.options.html = "<span class='ui-bar ui-overlay-c ui-corner-all'><i class='fa fa-spinner fa-spin fa-5x' style='color:#000;'></i></span>";
});
</script>
結果是一個旋轉的方塊,我哪里錯了?
首先,安裝Font Awesome:
下載最新的Font Awesome版本雙擊fontawesome-webfont.ttf並將其安裝在您的筆記本電腦/台式機上(可選)將fontawesome.css復制到www / css刪除fontawesome.css中對字體文件的引用,即刪除@ font-face聲明然后在Xcode中:
將fontawesome-webfont.ttf復制到“Your Project / Resources / fonts / fontawesome-webfont.ttf”中,通過選擇“Info”選項卡,將Font Awesome添加到.plist文件中添加名為“由應用程序提供的字體”的新屬性並設置價值“fontawesome-webfont.ttf”清理並構建您的項目。 Font Awesome現在可以使用了。
Phonegap示例:class =“fa fa-cog”
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.