How to hide the increment or decrement button in Xamarin.Forms numeric control (SfNumericUpDown)
The SfNumericUpDown control provides up and down buttons to increase and decrease numeric values. The control respects UI culture and it can be configured to display different formats like currency, scientific, etc. You can refer the below screenshot for the appearance of the control.
This section explains how to hide the decrement button in NumericUpdown (SfNumericUpDown) control.
Steps
- Create a NumericUpDown button.
- Update the DecrementButtonSettings by setting the button’s height and width as 0.
Please find the complete code snippet below.
[XAML]
xmlns:numericupdown="clr-namespace:Syncfusion.SfNumericUpDown.XForms;assembly=Syncfusion.SfNumericUpDown.XForms" <StackLayout> <numericupdown:SfNumericUpDown> <!-- Setting the Button width and height to 0 will hide the button --> <numericupdown:SfNumericUpDown.DecrementButtonSettings> <numericupdown:UpDownButtonSettings ButtonHeight="0" ButtonWidth="0" /> </numericupdown:SfNumericUpDown.DecrementButtonSettings> </numericupdown:SfNumericUpDown> </StackLayout>
Output
You can find the sample in the following link: Sample
The same can be applied to increment button in the control.
Currently we have support to hide the increment or decrement button in our SfNumericUpDown with Android and iOS platforms alone.
See Also
How to customize the color appearance of numeric controls
How to set customized currency symbol in Xamarin.Forms numeric controls
How to display the value with currency symbol in Xamarin.Forms numeric controls
Does SfNumericUpDown support other formats