I try to change the text color of the entry from a Xamarin Forms Prompt. I tried giving a default color for the Entry control in the App resource dictionary:
<Style TargetType="Entry">
<Setter Property="TextColor" Value="White"/>
</Style>
I also tried providing a style in the styles.xml
file of the Android project:
<style name="MainTheme" parent="MainTheme.Base">
<item name="android:colorActivatedHighlight">@android:color/transparent</item>
<item name="colorControlActivated">#FFFFFF</item>
<item name="colorControlNormal">#FFFFFF</item>"
<item name="colorAccent">#FFFFFF</item >
<item name="alertDialogTheme">@style/AppCompatAlertDialogStyle</item>
</style>
<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Dialog.Alert">
<!--buttons-->
<item name="colorAccent">#ffffff</item>
<!--title-->
<item name="android:textColor">#ffffff</item>
<!--text-->
<item name="android:textColorPrimary">#ffffff</item>
<!--selection list-->
<item name="android:textColorTertiary">#ffffff</item>
<!--background-->
<item name="android:background">#000000</item>
</style>
And yet no success. It just remains black, and I would like to change the default black to other color that would match my theme (green for instance). I don't care if the solution is cross-platform or not, as my project only targets Android for the moment, that's why I tried the styles.xml
approach. I guess there is a key for the dictionary of the style, but I just can't find it. Any idea how could I achieve this?
I think you have to give the TargetType a Name.
for example x:Key="AEntry"
In App.xaml
In Mainpage.xaml call Style