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

Inconsistent padding of Editor on Android vs iOS

I am trying to have an SfTexTInputLayout surround an Editor control and I can't seem to get the padding or sizing to be consistent across platforms.
On Android it renders nicely but on iOS it seems to add strange padding inside the control. The "hint" is also incorrectly placed on the Editor.

I have attached a sample project showing whats happening.

Attachment: TextInputExample_3e7f8749.zip

3 Replies

AL Alex July 5, 2019 08:06 PM UTC

Here is an image of what it does on Android. Notice the consistent size. I set the InputViewPadding to "2".

And here is what it does on iOS:

Notice how it is strangely positioned, appears to have a much larger InputViewPadding than "2", and the "hint" is not located properly along the outline.

RA Rachel A Syncfusion Team July 9, 2019 11:54 AM UTC

Hi Alex, 
Greetings from Syncfusion. 
We can reproduce the reported issue and have confirmed the issue in iOS platform. We have logged bug report for this issue internally. Meanwhile, you can resolve the issue using the below workaround. Please refer the code snippet for your reference.  
 public class CustomTIL : SfTextInputLayout
        public new Thickness InputViewPadding
            get { return (Thickness)GetValue(InputViewPaddingProperty); }
            set { SetValue(InputViewPaddingProperty, value); }

        public new static readonly BindableProperty InputViewPaddingProperty =
                 typeof(SfTextInputLayout), new Thickness(-1, -1, -1, -1), BindingMode.Default, null, OnInputViewPaddingPropertyChanged);

        private static void OnInputViewPaddingPropertyChanged(BindableObject bindable, object oldValue, object newValue)
            (bindable as CustomTIL).OnInputViewPaddingPropertyChanged(oldValue, newValue);

        private void OnInputViewPaddingPropertyChanged(object oldValue, object newValue)
            var newThickness = (Thickness)newValue;
            base.InputViewPadding = newThickness;

            if (Device.RuntimePlatform == Device.iOS)
                var container = (this.Children[0as StackLayout).Children[0as Grid;
                container.RowDefinitions[0].Height = newThickness.Top;
                container.RowDefinitions[2].Height = newThickness.Bottom;
Also, you can download the reference sample from the below link. 
We will include this fix in our upcoming Volume 2 SP1 release which will be rolled out by the month of August, 2019. 
Please let us know if you need further assistance on this. 

RA Rachel A Syncfusion Team August 27, 2019 12:42 PM UTC

Hi Alex, 
We are glad to announce that our weekly NuGet was rolled out today and fix for the reported issue was included in the weekly NuGet. 
NuGet Version:
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

Live Chat Icon For mobile
Up arrow icon