We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to center align the Expander Header Text in Xamarin.Forms (SfExpander)

Thread ID:





148858 Nov 6,2019 02:00 PM UTC Nov 8,2019 05:44 AM UTC Xamarin.Forms 3
Tags: SfExpander
Asked On November 6, 2019 02:00 PM UTC


SfExpander text alignment is not centering on Android but it centers on UWP and IOS. The HorizontalTextAlignment is set to center as follows: 

Please see below for examples



Please see attached demo project for example on the second page of the rotator. 

Any assistance would be greatly appreciated.

Attachment: SfExpander_88dea701.rar

Gnana Priya Namasivayam [Syncfusion]
Replied On November 7, 2019 10:54 AM UTC

Hi Taahir, 
We have checked the reported query from our side. We would like to inform you that the reported issue gets replicated when the label is loaded directly inside the ContentView. We directly inherited from native views and we didn't handle alignment related changes. You can overcome this issue by adding the label inside any of the containers like Grid in the following code snippet. 
<expander:SfExpander HeaderIconPosition="End" BackgroundColor="#FFFFFF" HeaderBackgroundColor="#FFFFFF" AnimationDuration="200" IsExpanded="True"> 
         <Label Text="Header Details" FontSize="16" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/> 
         <Label Text="Content Details" FontSize="16" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/> 
We hope this helps. Please let us know if you require any further assistance. 
Gnana Priya N 

Replied On November 7, 2019 11:10 AM UTC


Thank you very much. This does resolve the issue. 

Gnana Priya Namasivayam [Syncfusion]
Replied On November 8, 2019 05:44 AM UTC

Hi Taahir,

Thanks for the update.

We are glad that the reported issue has been resolved. 

Gnana Priya N


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon