c# - How to get value of string created in resources Xamarin.android -
i developing android application in xamarin studios , want make text of button underlined. created string in strings.xml following
<string name="advanced_search"><u>advanced search</u></string>
i succesfully able reference string in xml file desginer, want access in code set button's text. tried following doesn't work:
advancedsearchbutton.text = resource.string.advanced_search.tostring();
when try reference string integer value string, want text string holds. how can access string in xamarin using c#?
you need use resources.getstring
:
advancedsearchbutton.text = resources.getstring(resource.string.advanced_search);
this assuming code contained within activity
, otherwise need have reference android context
.
Comments
Post a Comment