Forum Xamarin.Forms

Problem with scrolling in my iOS App.

JulianPasqueJulianPasque USMember ✭✭✭

Hey guys,
I am facing a problem with scrolling in a ScrollView in my iOS App. My aim is to implement a chatview.
My XAML looks like this:

<Grid VerticalOptions="Fill" x:Name="MainGrid" Padding="5,5,0,15">
          <RowDefinition Height="*" />
          <RowDefinition Height="Auto" />
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="Auto"/>
        <local:ChatScrollView x:Name="ChatList" Padding="10" Grid.Row="0" Grid.ColumnSpan="2" VerticalOptions="FillAndExpand" >
          <StackLayout x:Name="ChatMessagesListView"  />
        <services:EditorGrows Grid.Column="0" Grid.Row="1" AutomationId="EntryMessage" Keyboard="Chat" x:Name="ChatText" Text="" HorizontalOptions="FillAndExpand" Focused="KeyBoardVisible" Unfocused="KeyBoardInVisible"/>
        <Button Grid.Column="1" AutomationId="ButtonMessage" Grid.Row="1" Style="{DynamicResource SecondaryActionButtonStyle}" Text="Senden" VerticalOptions="EndAndExpand"  Clicked="CmdSend"/>

This is the EditorGrows:

public class EditorGrows : Editor { public EditorGrows() { this.TextChanged += (sender, e) => { this.InvalidateMeasure(); }; } }

On Android everything is working perfectly, but on iOS when I press "Return" on the keyboard the Scrollview scrolls to the top and this is what I don't want to happen.

Could it be, that the ScrollView is scrolling because of the call fo the InvalidateMeasure method?

Best regards


Sign In or Register to comment.