Search code examples
windowseditordesktop-applicationmauimaui-windows

Maui windows desktop editor appearance


I would like to change the appearance of the Editor control in .Net Maui for Windows Desktop.

If you add a standard Editor to page, for example...

<Editor WidthRequest="300"/>

... a editor control is added which has quite a large amount of empty space between the text and the bottom border line...

enter image description here

This differs from the editors used in the windows desktop o/s itself which are normally quite compact...

enter image description here

Does anyone know if it is possible to change this?


Solution

  • You could try the VerticalTextAlignment="Center" to let the text in the center

    <Editor WidthRequest="300" BackgroundColor="Yellow"  VerticalTextAlignment="Center" />
    

    Also editor has MinimumHeightRequest and HeightRequest property as @ToolmakerSteve suggest in the comment, you could also try set these values.

    There are also many properties for editor. For more info, you could refer to .Net MAUI Editor.

    By the way, editor is used to enter and edit multiple lines of text. If you want only one line, you could also use an Entry (.Net Maui Entry)

    Hope it works for you.