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

SfTextInputLayout ArgumentException (Layout: -84 < 0") in complex layout

Hi Team,
i'am migrating a xamarin app to maui and face a strange problem with the SfTextInputLayout.
In one page it's working perfectly but in another complexer page there occurs an argument exception [1].

I can not post the complete source but here ist the principle structure of the page

<ContentPage>

  <ScrollView VerticalScrollBarVisibility="Never">

     <Grid RowDefinitions="Auto,*,Auto">

        <!-- 0-HEADER -->

        <Frame Grid.Row="0">

        </Frame>


        <!-- 1-CONTENT -->

        <Frame Grid.Row="1" VerticalOptions="FillAndExpand"

          <StackLayout VerticalOptions="StartAndExpand" Padding="5" Spacing="10">

            <Frame>

            </Frame>


            <Frame>

              <StackLayout Orientation="Vertical">

                 <StackLayout Orientation="Horizontal">

                 </StackLayout>

                 <StackLayout Orientation="Horizontal">

<!-- inputLayout crashing app, use entry as workaround -->

                    <inputLayout:SfTextInputLayout Hint="hint" HelperText="helptext" LeadingViewPosition="Inside">

                        <inputLayout:SfTextInputLayout.LeadingView>

                            <Image Source="home.png" HeightRequest="32" WidthRequest="32" />

                        </inputLayout:SfTextInputLayout.LeadingView>

                    </inputLayout:SfTextInputLayout>


[...]


maybe there is already a bugfix in the next release?
greetings Andrew


---
[1] Maui App Android Platform

Exception = "Java.Lang.IllegalArgumentException: Layout: -84 < 0"
relevant android Source:
https://cs.android.com/android/_/android/platform/frameworks/base/+/b2d8eb58a29c331c23c57712af936a670cb61b33:core/java/android/text/Layout.java;l=253;drc=7ad499d00716f45fffdf7331493ed21d1b8d9b77



2 Replies

AN Andrew January 31, 2023 01:24 PM UTC

I forgot the enviroment versions

  • Windows  Microsoft Visual Studio Community 2022 (64-Bit) - Current Version 17.4.4
  • Maui App targeting net7.0 and deployed directly on test-device Google Pixel 4a
  • Syncfusion.Maui.Core 20.4.43




SR Shivani Ramakrishnan Syncfusion Team February 1, 2023 12:28 PM UTC

Hi Andrew,

 

Thanks for contacting syncfusion support.

 

We have checked your code snippet. You should add Entry inside SfTextInputLayout , maybe because you did not add Entry it is showing an exception. We have attached a sample for your reference. Here is the code snippet:

 

 <StackLayout Orientation="Horizontal">

        <inputLayout:SfTextInputLayout Hint="hint" HelperText="helptext" LeadingViewPosition="Inside">

                 <Entry WidthRequest="100"/>
<inputLayout:SfTextInputLayout.LeadingView>

                                 <Image Source="home.png" HeightRequest="32" WidthRequest="32" />

                   </inputLayout:SfTextInputLayout.LeadingView>

          </inputLayout:SfTextInputLayout>
</StackLayout>



Here is the UG Link for your reference: https://help.syncfusion.com/maui/textinputlayout/custom-icons#leading-view

 

Even if you face an exception in the sample. Kindly reproduce the issue in the sample and share us. So only we can provide the solution as early as possible. Please let us know if you need any other details..

 

Regards,
Shivani


Attachment: TextInputApp_d104aeec.zip

Loader.
Up arrow icon