Here is my first try with the RichTextEditor where the editor and toolbox are created using C# code:
<VerticalStackLayout x:Name="VSL" VerticalOptions="Fill" Padding="2">
</VerticalStackLayout>
Grid grd = new Grid
{
RowDefinitions =
{
new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) },
new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }
},
ColumnDefinitions =
{
new ColumnDefinition{ Width = new GridLength(1, GridUnitType.Star) }
},
VerticalOptions = LayoutOptions.Fill,
HorizontalOptions = LayoutOptions.Fill
};
RadRichTextEditor rte = new()
{
Source = RichTextSource.FromString("<b>Hello .NET Maui</b>"),
BorderThickness = new Thickness(1),
BorderColor = Colors.Red,
VerticalOptions = LayoutOptions.Fill,
HorizontalOptions = LayoutOptions.Fill
};
RadRichTextEditorToolbar rtet = new()
{
HeightRequest = 60,
RichTextEditor = rte,
AutoGenerateItems = true
};
grd.Add(rtet, 0, 0);
grd.Add(rte, 0, 1);
VSL.Add(grd);
A problem arises. The editor is slowly built up vertically when the page is called up. But this construction does not end and the height of the editor becomes almost infinite.
If I give a fixed value for HeightRequest instead of VerticalOptions = Fille then the behavior is ok.
What's wrong with my code?