Issue
Is it possible to use a string resource in xaml from the resx file in xamarin.android? (like @ string / stringResource) There are a lot of examples for xamarin.forms and unfortunately I can't find anything for xamarin.android.
Solution
In Xamarin.Forms, you could use the Resx files
. You create the files for the Forms project. I take the Localization
for reference.
But if you want to do something like resx on Android, you need to use the Strings.xml
file like what you said @string
. On Android platform, it has different implementation. Create a Strings.xml
file of value folder inside Resource folder.
Xamarin.Forms:
For more details about the Xamarin.Forms String and Image Localization, please check the link. https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/localization/text?pivots=windows#create-resx-files
You could download the sample from the link below. https://docs.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/usingresxlocalization/
Xamarin.Android:
- For more details about Android Localization, you could refer to the link below. https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/localization
Answered By - Wendy Zang - MSFT
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.