我有以下XAML代碼:了java.lang.RuntimeException:字體資產未發現的Roboto光強(初級)
<Label Text="Hello Forms with XAML">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<OnPlatform.iOS>Roboto-Light</OnPlatform.iOS>
<OnPlatform.Android>Roboto-Light.ttf#Roboto-Light</OnPlatform.Android>
<OnPlatform.WinPhone>Assets/Fonts/Roboto-Light.ttf#Roboto-Light</OnPlatform.WinPhone>
</OnPlatform>
</Label.FontFamily>
</Label>
但是我得到的錯誤「了java.lang.RuntimeException:找不到字體資產的Roboto - 輕」即使字體被放置在Assets文件夾:
我能做些什麼來解決這個問題?
右鍵單擊,轉到屬性並檢查生成操作。它也應該有一些「資產」的東西。另外,我認爲Android不太喜歡連字符(' - '符號)。嘗試刪除它。 –
構建操作是AndroidAsset – Radu