TextColor changes on Focus

3 posts, 0 answers
  1. John
    John avatar
    10 posts
    Member since:
    Jan 2019

    Posted 09 Jan 2019 Link to this post

    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. Didi
    Didi avatar
    273 posts

    Posted 14 Jan 2019 Link to this post

    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.

    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
  3. John
    John avatar
    10 posts
    Member since:
    Jan 2019

    Posted 14 Jan 2019 in reply to Didi Link to this post

    Thanks! That worked perfectly. I appreciate your help on that!
Back to Top