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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Horizontally center SfComboBox

Thread ID:

Created:

Updated:

Platform:

Replies:

148386 Oct 17,2019 12:10 PM UTC Oct 29,2019 08:36 AM UTC Xamarin.Forms 4
loading
Tags: SfComboBox
Marco Negroni
Asked On October 17, 2019 12:10 PM UTC

Good afternoon,
i'm trying to horizontally center a SfComboBox without success, seems that HorizontalOptions="Center" is not working.
If i try using a standard Xamarin.Forms Picker works fine, this is my code:

<ScrollView>
<StackLayout Padding="16">
<sfComboBox:SfComboBox HorizontalOptions="Center"/>
</StackLayout>
</ScrollView>

Using a standard Picker works fine:

<ScrollView>
<StackLayout Padding="16">
<Picker HorizontalOptions="Center"/>
</StackLayout>
</ScrollView>

Always uses all the available space; i have the same problem also inside a TextInputLayout.

Thanks in advance

Hemalatha Marikumar [Syncfusion]
Replied On October 18, 2019 01:44 PM UTC

Hi Marco, 
 
Greetings from Syncfusion.  
 
Currently we are validating the reported query with SfComboBox and TextInputLayout, will update the complete details on October 21,2019. 
 
We appreciate your patience until then. 
 
Regards, 
Hemalatha M. 


Kanimozhi Gunasekaran [Syncfusion]
Replied On October 21, 2019 12:57 PM UTC

Hi Marco, 
 
In a StackLayout, the SfComboBox default width has taken full size. So, we would like to let you know that the WidthRequest needs to be set for the SfComboBox to render at the center. Please have the code snippet below,  
 
Code Snippet: 
 <ScrollView>  
<StackLayout Padding="16">   
<combobox:SfComboBox HorizontalOptions="Center" WidthRequest="100" /> </StackLayout> 
 </ScrollView> 
 
Please check with the above and let us know if you have any concerns. 
 
Regards,
Kanimozhi G.
 


Marco Negroni
Replied On October 28, 2019 01:47 PM UTC

Good afternoon,

inside a Grid is the same, takes always full space available.

Thanks in advance

Rabhia Beham Kathar Mideenar [Syncfusion]
Replied On October 29, 2019 08:36 AM UTC

Hi Marco,

In a Grid, Entry also takes the full space. So, we would like to let you know that the WidthRequest and HeightRequest needs to be set for the SfComboBox to render at the center. Please have the code snippet below,

Code Snippet:

<ScrollView>
        <Grid>  
            <combobox:SfComboBox HorizontalOptions="Center"
                                 WidthRequest="100"
                                 HeightRequest="50"
                                 VerticalOptions="Center"/>
        </Grid>
 </ScrollView>

Please check with the above and let us know if you have any concerns.

Regards,
Rabhia Beham K.
 


CONFIRMATION

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