0
votes

In my xamarin.forms app i am using this entry:

                        <Entry
                             x:Name="entry_passwort_login"
                             PlaceholderColor="#ffffff"
                             TextColor="#ffffff"
                             IsPassword="true"
                             FontFamily="Galvji-01.ttf"
                             HorizontalOptions="FillAndExpand"
                             VerticalOptions="Start"
                             Placeholder="Passwort"/>

It looks great on Android, since the background is black. I also made changes in the styles.xml to get the highlighted color of the element to yellow.

But iOS renders an entry with a white box in the background:

enter image description here

As you can see, therefore neither the placeholder NOR the actual text that is written on them is visible. But I dont want to change the whole background.

How can I make the placeholder and text color of the entries for IOS ONLY black, while leaving all the android set up untouched?

Thank you!

1
Do you want to do it from XAML? Or with a style? Or you don't care? You're looking for this either way: docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/xaml-basics/…Gerald Versluis

1 Answers

1
votes

You can sepecific other color in the iOS. For example, I set it PlaceholderColor to Red in iOS like following code.

            <Entry
                             x:Name="entry_passwort_login"
                             TextColor="#ffffff"
                             FontFamily="Galvji-01.ttf"
                             IsPassword="true"
                             HorizontalOptions="FillAndExpand"
                             VerticalOptions="Start"
                             Placeholder="Passwort">
                <Entry.PlaceholderColor>
                    <OnPlatform x:TypeArguments="Color">
                        <On Platform="iOS" Value="Red"></On>
                        <On Platform="Android" Value="#ffffff"></On>
                    </OnPlatform>
                </Entry.PlaceholderColor>
                
            </Entry>