This is a migrated thread and some comments may be shown as answers.

TextColor changes on Focus

2 Answers 67 Views
Entry
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 09 Jan 2019, 04:08 PM

In a Xamarin.Forms UWP project, I have a dark background color on my page. I've used the following code for a username entry:

<telerikInput:RadEntry x:Name="UsernameEntry" WidthRequest="100" BorderStyle="{StaticResource EntryBorderStyle}" TextColor="White" BackgroundColor="Transparent" FontSize="30" Focused="IsFocus"/>

When I focus on the entry to type, the typed characters are black, and when unfocused, they turn to white. I want them to always be white, as the black is hard to read against the background color.

I tried the following:

public void IsFocus(object sender, EventArgs e)
       {
           var obj = (Telerik.XamarinForms.Input.RadEntry)sender;
           obj.TextColor = Color.White;

     }

 

.. but this seems to have no effect either. Any suggestions on how I can keep the focused and unfocused TextColor consistent?

 

 

 

2 Answers, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 14 Jan 2019, 09:53 AM
Hello John,

Thank you for the provided code.

The behavior you are observing with the RadEntry on UWP is the expected one by default. The RadEntry control uses the native UWP TextBox style. I have created a sample that shows how to modify the default style of the native TextBox control in order to change the text color of the RadEntry in UWP.

Please take a look at the App.xaml file in UWP project and let me know if you have any additional questions.

Regards,
Didi
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
John
Top achievements
Rank 1
answered on 14 Jan 2019, 05:09 PM
Thanks! That worked perfectly. I appreciate your help on that!
Tags
Entry
Asked by
John
Top achievements
Rank 1
Answers by
Didi
Telerik team
John
Top achievements
Rank 1
Share this question
or