Android - ItemTemplate is not resized properly

Hello,

We have same ItemTemplate in our production app like you can see in attached sample app. Problem is that component is not resized properly if its located in SfListview. If its located outside of SfListview it works well. You can reproduce this behavior in sample app. In the first column is located element outside of SfListview and second column contains SfListView with this element like ItemTemplate.


STR:

1) Open app

2) Type some text until you reach the end of the line. If the text in the first line is longer, it will move to the new line, but the editor will not resize.

3) If you type next letter editor is resized.


I don't know whether it will help you but I have found out that if i change(or revert to default -> 20) Frame padding to e.g. 10 it works.


Device: Samsung Galaxy Tab S6 Lite; Android 11


Attachment: ResizingApp_1c3fcc0d.zip


5 Replies

LN Lakshmi Natarajan Syncfusion Team June 22, 2022 12:26 PM UTC

Hi Lukas,


We have checked the sample given in Samsung Galaxy Tab A (Android 7.1.1 – API 25) device and Pixel 5 (Android 12 - API 31) emulator. Unfortunately, we are unable to replicate the reported scenario. We have attached the tested video for your reference.


Could you please check the video and revert us back with the proper replication video for better understanding of the issue? It will be helpful for us to check on it and provide you with the solution as soon as possible.


Regards,

Lakshmi Natarajan


Attachment: 175765Video_ed8227b9.zip


LS Lukas Sugra June 22, 2022 01:00 PM UTC

Hello Lakshmi,

Here you go.


Attachment: Screen_Recording_20220622145749_9dffb0aa.zip


LN Lakshmi Natarajan Syncfusion Team June 24, 2022 03:53 AM UTC

Hi Lukas,


In our testing device, we could not replicate the reported scenario. Could you please confirm whether the reported scenario can be reproduced in any other device? If yes, please share the details which will be helpful for us to check on it and provide you with the solution as soon as possible.


Also, we would like to inform you that adding scrollable control inside the ScrollView is not recommended in Xamarin forms. The Xamarin.Forms warns the usage of nested ScrollView. You can refer to the following documentation regarding the same from the following links,

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/layouts/scrollview

https://forums.xamarin.com/discussion/106311/can-you-have-a-scrollview-in-a-scrollview


Hence, please remove the ScrollView used in the ItemTemplate and let us know if this helps.


Regards,

Lakshmi Natarajan




LS Lukas Sugra June 29, 2022 08:25 AM UTC

Hi SaiGanesh,

We are able to reproduce on more devices: Samsung Galaxy A52, Samsung Galaxy Tab S3. I have no more information about that but you will try to type various letters and spaces and you can try change device scale too.

My scale configuration:



LN Lakshmi Natarajan Syncfusion Team June 30, 2022 12:38 PM UTC

Hi Lukas,


The reported scenario occurs when using ScrollView in the ItemTemplate. As we have mentioned in our previous update, usage of nested ScrollView is not recommended in Xamarin.Forms. We suggest you remove the ScrollView used in the ItemTemplate to overcome the reported scenario.


Please refer to the following code snippets for more reference,

<xForms:SfListView Grid.Column="1" AutoFitMode="DynamicHeight" x:Name="_sfListViw">

    <xForms:SfListView.ItemTemplate>

        <DataTemplate>

            <Frame   Padding="0"

                BorderColor="Red">

                <FlexLayout x:Name="_mainFlexLayout"

                        VerticalOptions="FillAndExpand"

                        HorizontalOptions="FillAndExpand"

                        JustifyContent="Start"

                        Direction="Row"

                        AlignItems="Center"

                        Wrap="Wrap" >

                    <Editor AutoSize="TextChanges" FlexLayout.Grow="1"></Editor>

                </FlexLayout>

            </Frame>

        </DataTemplate>

    </xForms:SfListView.ItemTemplate>

</xForms:SfListView>


Please let us know if you need further assistance.


Regards,

Lakshmi Natarajan


Loader.
Up arrow icon