是否可以在 xamarin.android 中的 resx 檔案中使用 xaml 中的字串資源?(如@string / stringResource)有很多xamarin.forms的例子,不幸的是我找不到xamarin.android的任何東西。
uj5u.com熱心網友回復:
在 Xamarin.Forms 中,您可以使用Resx files. 您為 Forms 專案創建檔案。我拿來Localization作為參考。
但是如果你想在 Android 上做類似 resx 的事情,你需要Strings.xml像你說的那樣使用檔案@string。在Android平臺上,它有不同的實作。Strings.xml在 Resource 檔案夾中創建一個value 檔案夾的檔案。
Xamarin.Forms:
有關 Xamarin.Forms 字串和影像本地化的更多詳細資訊,請查看鏈接。 https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/localization/text?pivots=windows#create-resx-files
您可以從下面的鏈接下載示例。 https://docs.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/usingresxlocalization/
Xamarin.Android:
- 有關 Android 本地化的更多詳細資訊,您可以參考下面的鏈接。https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/localization
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/409078.html
標籤:
上一篇:交換兩個結構的元素
下一篇:CanSearchCommandExcute正在更新搜索按鈕的IsEnabled屬性,但TextBox樣式未按應有的方式更新
