Cannot set platform specific values in style for inputviewpadding

Hi,

I am trying to set platform specific InputViewPadding in a style, but when I try it just doesn't work. It doesn't use the value. The reason I am doing this, is because on the Android version the sizing looks correct, but on IOS the input box is too big and overlaps stuff. Hence the need for different values based on platform.

Here is the example style in question:

<Style TargetType="input:SfTextInputLayout" x:Key="sfi_default">

        <Setter Property="InputViewPadding">

            <OnPlatform x:TypeArguments="x:Double">

                <On Platform="iOS" Value="5" />

                <On Platform="Android" Value="8" />

            </OnPlatform>

        </Setter>

    </Style>


1 Reply

SS Sridevi Sivakumar Syncfusion Team July 26, 2021 09:21 AM UTC

Hi Rigardt,

Greetings from Syncfusion.


We would like to inform you that the data type of the SfTextInputLayout InputViewPadding property is Thickness, but you have set it to double. As a reason, InputViewPadding does not work. You can resolve it  by using Thickness instead of Double as per the below code snippet

[XAML]:
 
 
<Style TargetType="input:SfTextInputLayout" x:Key="sfi_default"> 
        <Setter Property="InputViewPadding"> 
            <OnPlatform x:TypeArguments="Thickness"> 
                <On Platform="iOS" Value="5" /> 
                <On Platform="Android" Value="8" /> 
            </OnPlatform> 
        </Setter> 
    </Style> 

Let us know if you need any further assistance.

Regards,
Sridevi S.
 


Loader.
Up arrow icon