Button text is cut off in grid

Viewed 232

If I have a button in a StackLayout I can write as much text as I want and the button gets bigger automatically. But if I have two buttons next to each other in a grid it doesn't work and the text is cut off.

<StackLayout>
                        
                        <Button
                            FontSize="Large"
                            Style="{DynamicResource PrimaryColorFullButton}"
                            Text="{resources:TranslateExtensions ErrorConnectionMessage}"
                            Command="{Binding ExecuteLoginCommand}" />
                    
                        <Grid
                            RowDefinitions="*,50"
                            ColumnDefinitions="*,*">
                    
                            <Button
                                Grid.Row="0"
                                Grid.Column="0"
                                Text="{resources:TranslateExtensions NewAccount}"
                                Command="{Binding ExecuteRegistrationCommand}"
                                Style="{DynamicResource TransparentFullButtonStyle}">
                            </Button>
                    
                            <Button 
                                Grid.Row="0"
                                Grid.Column="1"
                                Text="{resources:TranslateExtensions LoginForgotten}"
                                Command="{Binding ExecuteForgotPasswordCommand}"
                                Style="{DynamicResource TransparentFullButtonStyle}">
                            </Button>
                    
                        </Grid>    
                    </StackLayout>    

enter image description here

how can I prevent the text from being cut off?

1 Answers

Remove ,50 from your Grid's RowDefinitions.

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

It is reserving a blank/white rectangle with a height of 50 at the bottom of your StackLayout's available space, which is cutting off your buttons which are on Row 0.

Related