Expand Layout when Editor TextChanges fires?

95 Views Asked by At

I have an issue i want to have a scrollview or anything similar above an Editor, but I cant seem to find a way to align it when the editor adds a new line on TextChanges, here is the layout it is worth noting that it fit fine when there is another row definition on the Grid when the editor has 4 lines and the 4th definition is around 60 and with 3 lines when it is around the 4th row definiion is 30(I am doing this because the keyboard overlaps the Editor if there isn't a 4th row.... what could I change?

  <Grid >
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
            <!--<RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="5*"></RowDefinition>
            <RowDefinition Height="1.7*"></RowDefinition>-->
            <RowDefinition Height="60" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="50" />
            <RowDefinition Height="60" />
            <!--<RowDefinition Height="1*"></RowDefinition>-->
           </Grid.RowDefinitions>

         <StackLayout Grid.Row="0"   Orientation="Vertical">
            <Entry BackgroundColor="Black" VerticalOptions="FillAndExpand">
                
            </Entry>
        </StackLayout>
        
            <ScrollView Margin="0,00,0,0" VerticalOptions="Start"  Grid.Row="1">
                    <Image
                    Source="dotnet_bot.png"
                    WidthRequest="250"
                    HeightRequest="310"
                     Margin="20,10,10,0"
                    HorizontalOptions="Center" />

                </StackLayout>
            </ScrollView>
        <StackLayout Grid.Row="2" Orientation="Vertical" Padding="0,0,0,-60"
                         VerticalOptions="FillAndExpand" >
            <Editor  Placeholder="" FontSize="Medium" 
                    x:Name="inputText"
                     VerticalOptions="Center"
                     
                     WidthRequest="345"
                     Margin="0,0,55,-1"
                     BackgroundColor="White"
                    TextColor="White"
                    AutoSize="TextChanges"  
                    Grid.Column="2"
                    Grid.Row="2"></Editor>
            <Button Text="Send" BackgroundColor="Gray" Grid.Column="1" x:Name="btnSend"  
                            Margin="335,-45,0,51" Grid.Row="2"
                        Clicked="OnSendButtonClicked"></Button>
            
        </StackLayout>
    </Grid>

what could you do you fit the (last editor above the keyboard)?

Thank you for any suggestion

0

There are 0 best solutions below