Unplanned
Last Updated: 15 Apr 2025 14:11 by James
James
Created on: 15 Apr 2025 14:11
Category: Entry
Type: Bug Report
0
Entry: [WinUI] Text is not centered horizontally when having a specific width

When setting horizontal text alignment to center, the text in Telerik Entry is not centered. In MAUI entry works. 

<ContentPage.Resources>
		<ResourceDictionary>
			<Style TargetType="telerik:RadEntry" x:Key="entry">
				<Setter Property="HeightRequest" Value="{OnPlatform WinUI=36,Android=40}"/>
				<Setter Property="WidthRequest"  Value="{OnPlatform WinUI=40,Android=40}"/>
				<Setter Property="MinimumWidthRequest"  Value="{OnPlatform WinUI=0,Android=10}"/>
				<Setter Property="MaxLength" Value="2"/>
				<Setter Property="FontSize" Value="15"/>
				<Setter Property="Margin" Value="0,0"/>
				<Setter Property="HorizontalTextAlignment" Value="Center"/>
				<Setter Property="VerticalTextAlignment" Value="Center"/>
				<Setter Property="HorizontalOptions" Value="Center"/>
			</Style>

			<Style TargetType="Entry" x:Key="mystyle">
				<Setter Property="HeightRequest" Value="{OnPlatform WinUI=36,Android=40}"/>
				<Setter Property="WidthRequest"  Value="{OnPlatform WinUI=40,Android=40}"/>
				<Setter Property="MinimumWidthRequest"  Value="{OnPlatform WinUI=0,Android=10}"/>
				<Setter Property="MaxLength" Value="2"/>
				<Setter Property="FontSize" Value="15"/>
				<Setter Property="Margin" Value="0,0"/>
				<Setter Property="HorizontalTextAlignment" Value="Center"/>
				<Setter Property="VerticalTextAlignment" Value="Center"/>
				<Setter Property="HorizontalOptions" Value="Center"/>
			</Style>
		</ResourceDictionary>
	</ContentPage.Resources>

	<VerticalStackLayout Spacing="10">
		<Entry Text="99" Style="{StaticResource mystyle}"/>
		<telerik:RadEntry Text="99" x:Name="entry" Style="{StaticResource entry}"
						  ClearButtonVisibility="Never" />

	</VerticalStackLayout>

 

0 comments