100% of the parent's width

валера карманов 396 Reputation points
2024-10-10T19:22:13.9966667+00:00

How to make the "Entry" element 100% of the width of its parent?2024-10-10_22-19-43

Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 50,126 Reputation points Microsoft External Staff
    2024-10-11T01:41:56.8866667+00:00

    Hello,

    The official recommended for filling Maui application controls is through Grid and using HorizontalOptions=“Fill”.

    Please refer to the following thread and sample code:

    <Grid Padding="8">
    	<Border Stroke="Black" HorizontalOptions="Fill">
    		<Grid ColumnDefinitions="30,*" Padding="8">
    			<Image Grid.Column="0" Source="dotnet_bot.png"/>
    			<Entry Grid.Column="1" Placeholder="test" HorizontalOptions="Fill"/>
    		</Grid>
    	</Border>
    </Grid>
    

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.