I am trying to get some style consistency in my xamarin forms app (for android alone for now). I'm trying to give all buttons the same look. In general, this is easily done by adding a Style in the App.xaml file with TargetType set to Button. The problem is that I'm using a Picker (also a TimePicker which has similar issues). When clicking this picker a pop up is shown with a cancel button. This cancel button I can not change the style for (changing background and border for example).
This screen shot of a dummy project explains the issue a bit more:
Apart from trying the App.xaml solution, I also tried to set the style in the android project by adjusting styles.xml. This did also have an influence on all the buttons except for the one in the Picker dialog.
Anyone any idea's on how to fix it?
Found a rather easy way to adjust the buttons style on the picker popup by only adjusting styles.xml. This solution is for android only. found the solution here: How can I change default dialog button text color in android 5
styles.xml will look something like this:
<style name="MainTheme" >
<item name="buttonBarNegativeButtonStyle">@style/ButtonStyle</item>
<item name="buttonBarPositiveButtonStyle">@style/ButtonStyle</item>
<item name="android:buttonStyle">@style/ButtonStyle</item>
</style>
<style name="ButtonStyle" >
<item name="android:textColor">#000000</item>
<item name="android:background">#FF0000</item>
</style>
The buttonBarNegativeButtonStyle, changes the cancel buttons style. This solution will also adjust the buttons in for example a TimePicker. (This also has buttonBarPositiveButtonStyle)
If you want control over the whole picker popup, then the solution of Bas H will be more appropriate