![](/img/trans.png)
[英]Xamarin Studio does not recognize iOS device even though XCode does
[英]Xamarin does not recognize the installed fonts
我正在嘗試開始使用Xamarin構建適用於ios的應用程序,但是我遇到了本地化問題。
我已經在Mac中安裝了一些自定義字體,Notes應用程序可以識別這些字體並且沒有問題。
但是字體沒有出現在Xamarin中控件的“屬性”面板中。
之前謝謝。
艾倫解決了這個問題。
用代碼實現的解決方案:
Xamarin iOS :
(ILabel).Font = UIFont.FromName ("font name", 30f);
您的字體需要在任何目錄中像“內容”一樣構建
Xamarin Android :
(TextView).SetTypeface(Typeface.CreateFromAsset(Application.Context.Assets, DISPLAY_FONT), TypefaceStyle.Normal);
(TextView).TextSize = 32;
需要復制到/Assets/(FONT).TTF
並且需要像AndroidAsset
一樣AndroidAsset
;-)
自定義字體應顯示在Xamarin Studio 5.7及更高版本的屬性面板中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.