Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145743 | Jul 5,2019 08:03 PM UTC | Aug 27,2019 12:42 PM UTC | Xamarin.Forms | 3 |
![]() |
Tags: SfTextInputLayout |
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[0] as StackLayout).Children[0] as Grid; container.RowDefinitions[0].Height = newThickness.Top; container.RowDefinitions[2].Height = newThickness.Bottom; } } } |
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.
This page will automatically be redirected to the sign-in page in 10 seconds.