Home > Software engineering >  AM/PM showing in different language in iOS
AM/PM showing in different language in iOS

Time:03-10

I have a time picker basically the user can select time with it. It's perfectly displaying in Android. But, am/pm is displaying in different language in iOS. Any idea why it is happening ?

Code

                               <TimePicker x:Name="time"
                                BackgroundColor="Transparent"
                                Format="hh:mm tt"
                                TextColor="{StaticResource TitleColor}"
                                Focused="time_Focused"
                                HorizontalOptions="CenterAndExpand"/>


time.Time = new TimeSpan(07, 30, 00);

View

CodePudding user response:

I know in just regular c# I would do something like this: date1.ToString("hh:mm tt", CultureInfo.InvariantCulture) but I don't know how to add culture information in xaml code.

CodePudding user response:

  1. You can check if the language supports English.

  2. You can use Custom Renderer to override it.

    This link introduces the method of rewriting. You can refer to the specific method inside.

  • Related