- Home
- Forum
- Xamarin.Forms
- Dark Mode Text Color on SfTextInputLayout
Dark Mode Text Color on SfTextInputLayout
Hi,
Attachment: ScheduleXamarin_1093c954.rar
When using Dark Mode the text color of the SfTextInputLayout control remains black
resulting invisible text.
Please take a look at the attached demo.
Attachment: ScheduleXamarin_1093c954.rar
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
AS
Anandraj Selvam
Syncfusion Team
June 26, 2020 11:49 AM UTC
Hi George,
Greetings from the Syncfusion.
We have checked the reported query with the provided sample, and we have resolved by overring the primary keys in theme resource dictionary as below code snippet:
Darktheme.xaml
|
<ResourceDictionary.MergedDictionaries>
<syncTheme:DarkTheme />
<inputLayout:SfTextInputLayoutStyles />
<ResourceDictionary>
<Color x:Key="SfTextInputLayoutContainerBackgroundColor">Black</Color>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries> |
Screenshot:
Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ScheduleXamarin-1269464140
Please go through the below link for more details
Please revert us for further investigation.
Regards,
Anand Raj S.
GE
George
June 26, 2020 06:37 PM UTC
Thank you for your answer.
Maybe i was not clear enough.
If you read more carefully my first post you will see
that my problem is about the TextColor of the input text of the SfTextInputLayout.
Not the BackgroundColor or Hint Color.
I was also talking about switching from Light Mode to Dark Mode.
On Light Mode everyting is working fine.Black text on white Background.
But the problem is when i switch from Device's Light Mode to Dark Mode.
On the provided demo please switch from device's Light Mode to Dark Mode and
try to type something in the SfTextInputLayout.You will see that text is not visible
because the TextColor of the input text is Black.
Thats my problem.
AS
Anandraj Selvam
Syncfusion Team
June 29, 2020 12:41 PM UTC
Hi George,
Thanks for the update.
We have checked the reported query and we have achieved your requirement by changing the text color manually based on themes as below code snippet:
App.xaml
|
<Application.Resources>
<ResourceDictionary Source="Themes/LightTheme.xaml" />
<Color x:Key="SfTextInputLayoutContainerBackgroundColor">White</Color>
<Style x:Key="EntryStyle"
TargetType="Entry">
<Setter Property="TextColor"
Value="{DynamicResource PrimaryTextColor}" />
<Setter Property="FontSize"
Value="16" />
</Style>
</Application.Resources> |
[XAML]
|
<StackLayout Margin="20"
VerticalOptions="CenterAndExpand">
<inputLayout:SfTextInputLayout Hint="Name" IsHintAlwaysFloated="True" HelperText="Enter your name">
<Entry Text="James" Style="{StaticResource EntryStyle}"/>
</inputLayout:SfTextInputLayout>
<Button Text="Light" x:Name="button" Clicked="Button_Clicked"
HorizontalOptions="Center"
VerticalOptions="Center" />
</StackLayout> |
[C#]
|
private void Button_Clicked(object sender, EventArgs e)
{
if (button.Text == "Light")
{
Application.Current.Resources["SfTextInputLayoutContainerBackgroundColor"] = Color.Black;
Application.Current.Resources["PrimaryTextColor"] = Color.White;
button.Text = "Dark";
}
else
{
Application.Current.Resources["SfTextInputLayoutContainerBackgroundColor"] = Color.White;
Application.Current.Resources["PrimaryTextColor"] = Color.Black;
button.Text = "Light";
}
} |
Please revert us for further investigation.
Regards,
Anand Raj S.
Marked as answer
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
- Marked answer
-
GE George
- Jun 25, 2020 10:58 AM UTC
- Jun 29, 2020 12:41 PM UTC