Bug in the tutorial: How to change the space between views in a StackLayout

Albert Einstein 0 Reputation points
2024-06-19T00:22:23.2066667+00:00

In this part of the training I found an error.
When the tutorial explain "How to change the space between views in a StackLayout" it needs to add for example the HeightRequest or WidthRequest depending the Orientation of the StackLayout.

If I run the project with these lines in the MainPage.xaml it doesn't show the views:
<StackLayout Spacing="30">

<BoxView Color="Silver" />

<BoxView Color="Blue" />

<BoxView Color="Gray" />

</StackLayout>

.NET Training
.NET Training
.NET: Microsoft Technologies based on the .NET software framework.Training: Instruction to develop new skills.
15 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pradeep M 4,560 Reputation points Microsoft Vendor
    2024-06-28T11:01:29.1666667+00:00

    Hi Albert Einstein,

    Thank you for reaching out to the Microsoft Q&A forum. 

    Where am I seeing this?

    Learning Path: Build mobile and desktop apps with .NET MAUI  

    Module:  Customize layout in .NET MAUI XAML pages  

    Unit 4: Arrange views with StackLayout 

    We appreciate your feedback regarding the StackLayout tutorial. I'm pleased to inform you that the content has been updated to address the issue you identified. The tutorial now includes the necessary details to ensure proper rendering when using spacing, by specifying the height or width requests for the child views. 

    Thank you for bringing this to our attention and helping us improve our training materials.  

    We believe this information is helpful to you! If so, please acknowledge it by clicking "Accept Answer" and "Upvote" on the post.   

    1 person found this answer helpful.
    0 comments No comments

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.