Xamarin.Forms on Android. Clicking picker opens dialog and the negative button has default text of "Cancel". How can I change it?
I looked in open source project of Xamarin and they set the positive button text like this
builder.SetNegativeButton(global::Android.Resource.String.Cancel, (s, a) => ...
This method is private so I cant override the class method.
Neither I can copy paste implementation of this class because its members are private to Xamarn dll-s...
Link to that picker implementation on Xamarin.Forms andoid:
As an alternative choice, you could rewrite the whole dialog in your
PickerRenderer
:Effect.
As the dialog itself is not a graphical element that is directly used in XAML, there is nothing that stops you from using the Android code directly in your project. If you use the shared project it is as simple as using the conditional compiling, if you use standard library then you need to use the dependency service.
On the XAML side you can use a sort of custom
EntryRenderer
to present the picked item on the screen, that is what Xamarin does with that anyway.