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

Inconsistent padding of Editor on Android vs iOS

Thread ID:

Created:

Updated:

Platform:

Replies:

145743 Jul 5,2019 08:03 PM UTC Aug 27,2019 12:42 PM UTC Xamarin.Forms 3
loading
Tags: SfTextInputLayout
Alex
Asked On July 5, 2019 08:03 PM UTC

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

Alex
Replied On 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.


Rachel A [Syncfusion]
Replied On 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.  
 
[C#] 
 public class CustomTIL : SfTextInputLayout
    {
        public new Thickness InputViewPadding
        {
            get { return (Thickness)GetValue(InputViewPaddingProperty); }
            set { SetValue(InputViewPaddingProperty, value); }
        }

        public new static readonly BindableProperty InputViewPaddingProperty =
            BindableProperty.Create("InputViewPadding"typeof(Thickness),
                 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. 
  
Regards, 
Rachel. 
 


Rachel A [Syncfusion]
Replied On 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: 17.2.0.47
 
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.
 
 
Thanks, 
Rachel. 


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