Search code examples
c#xamlmauimaui-windows

Entry doesn't follow available space (screen size)


I cannot resolve the sizing issue. I created a small example to show it. I have an entry field and a button:

<StackLayout>
    <Frame>
        <Grid ColumnDefinitions="*, Auto">
            <Entry/>
            <Button Grid.Column="1"
                    Text="ok"/>
        </Grid>
    </Frame>
</StackLayout>

It is simplified layout, please follow this structure.

When I input some text that is longer than the entry's width it works fine, but after I made the window smaller, the entry (input field) extends itself and move the button out of the view

enter image description here

enter image description here

enter image description here

I tried to use HorisontalOptions="Fill" for entry, it did not work


Solution

  • The code you have is correct.

    Run: dotnet workload list

    And see if your maui version is 7.0.86. (VS 17.6.5) (For this I am 100% sure)

    Or try to get 7.0.92. (Not sure for this)

    Everything in between is not ok. Everything before is not ok.

    Edit: Your version 7.0.86 (VS 17.6.4) is perfectly fine, do not risk updating. Change Frame to Border.