title: Editor goes behind the keyboard when it resized using Wordwrap in Xamarin.Forms (iOS)?
body: <p>I am proceeding further and generating new ticket as it is quite different from this issue <a href="https://stackoverflow.com/questions/56427967/how-to-prevent-editor-to-go-behind-the-keyboard-in-xamarin-forms">How to prevent Editor to go behind the keyboard in Xamarin.Forms?</a></p>
  
  <p>I have chat page and autosize editor. When user type more than 1-2 lines, Editor expand correctly but it goes behind the keyboard. </p>
  
  <p>However, if user add multiple lines using "return" it works correctly. I think I am missing something in Xaml page to play with Editor and StackLayout.</p>
  
  <p>Please suggest</p>
  
  <p>Please note that I don't use <code>Xam.Plugins.Forms.KeyboardOverlap</code>. To manage layout on keyboard visibility, I use custom stacklayout <code>WrapperStackLayoutRenderer</code> which set bottom padding on appear and disappear of keyboard.</p>
  
  <p>Page Xaml</p>
  
  <pre><code>&lt;ContentPage.Content&gt;
      &lt;local1:WrapperStackLayout&gt;
          &lt;Grid Margin="0" Padding="0" RowSpacing="0"&gt;
              &lt;Grid.RowDefinitions&gt;
                  &lt;RowDefinition Height="*"/&gt;
                  &lt;RowDefinition Height="auto"/&gt;
              &lt;/Grid.RowDefinitions&gt;
  
              &lt;ListView x:Name="MessagesListView" 
                  ItemTemplate="{StaticResource MessageTemplateSelector}"
                  ItemsSource="{Binding Conversations}" 
                  HasUnevenRows="True" 
                  Margin="0" 
                  Grid.Row="0"
                  SeparatorVisibility="None"/&gt;
  
              &lt;Grid RowSpacing="1" ColumnSpacing="2" Padding="5" Grid.Row="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition Width="*" /&gt;
                      &lt;ColumnDefinition Width="auto" /&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
                  &lt;local1:EditorWithAutoSize x:Name="txtMessage" Text="{Binding SendingText}" TextChanged="EnableSend"/&gt;
                  &lt;Frame x:Name="SendButton" Grid.Column="1" Margin= "0" Padding="0" HasShadow="false" HeightRequest="25"
              BackgroundColor="Transparent" HorizontalOptions="FillAndExpand"&gt;
                      &lt;Frame.GestureRecognizers&gt;
                          &lt;TapGestureRecognizer Tapped="SendMessage_Click" NumberOfTapsRequired="1" /&gt;
                      &lt;/Frame.GestureRecognizers&gt;
                      &lt;Label Text="Send" x:Name="sendButton" HeightRequest="20"
                  HorizontalOptions="Center" VerticalOptions="Center"/&gt;
                  &lt;/Frame&gt;
              &lt;/Grid&gt;
          &lt;/Grid&gt;
      &lt;/local1:WrapperStackLayout&gt;
  &lt;/ContentPage.Content&gt;
  </code></pre>
  
  <p>EditorWithAutoSize</p>
  
  <pre><code>public class EditorWithAutoSize : Editor
  {
      public EditorWithAutoSize()
      {
          this.TextChanged += (sender, e) =&gt; {
              this.InvalidateMeasure();
          };
      }
  }
  </code></pre>
  
  <p>WrapperStackLayout</p>
  
  <pre><code>public class WrapperStackLayout : StackLayout
  {
  }
  </code></pre>
  
  <p>WrapperStackLayoutRenderer</p>
  
  <pre><code>public class WrapperStackLayoutRenderer : VisualElementRenderer&lt;StackLayout&gt;
  {
      public WrapperStackLayoutRenderer()
      {
          UIKeyboard.Notifications.ObserveWillShow((sender, args) =&gt;
          {
              if (Element != null)
              {
                 Element.Margin = new Thickness(0, 0, 0, (args.FrameEnd.Height));
              }
          });
  
          UIKeyboard.Notifications.ObserveWillHide((sender, args) =&gt;
          {
              if (Element != null)
              {
                  Element.Margin = new Thickness(0); //set the margins to zero when keyboard is dismissed
              }
          });
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/6eEYX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6eEYX.png" alt="enter image description here"></a></p>