Category / Section
How to resolve the issue with decimal point and minus key on Samsung devices in SfNumericTextBox
1 min read
When using virtual numeric keyboard in SfNumericTextBox, decimal point and minus sign will be missing in some of the Samsung devices.
To resolve this issue, follow the below steps:
- Create a custom SfNumericTextBox by inheriting the SfNumericTextBox class.
- Similarly, create a CustomNumericTextBoxRenderer class by inheriting SfNumericTextBoxRenderer.
Code for custom renderer in Android:
[assembly: ExportRenderer(typeof(CustomNumeric), typeof(CustomNumericTextBoxRenderer))] namespace Samsung_issue.Droid { public class CustomNumericTextBoxRenderer : SfNumericTextBoxRenderer { protected override void OnElementChanged(ElementChangedEventArgs<SfNumericTextBox> e) { base.OnElementChanged(e); if (Control != null) { EditText control = this.Control as EditText; if (control != null) { control.InputType = Android.Text.InputTypes.ClassPhone; } } } } }
Output: