Forum Xamarin.Forms

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Boxview inside Stacklayout is not working

timilnishan2017timilnishan2017 Member ✭✭
edited October 2020 in Xamarin.Forms

Trying to achieve this goal in xamarin forms. seems like boxview inside stacklayout is not working.

With this code I am getting following output.

Not sure what i am doing wrong!!!

Best Answer

Answers

  • @JohnHardman Cool It was working!! Thanks a lot.

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    I use following code to achieve it.

     <StackLayout>
                <Grid HeightRequest="30">
                    <Grid.RowDefinitions>
    
                        <RowDefinition Height="2*" />
    
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <BoxView Grid.Column="0" WidthRequest="1" HeightRequest="1" BackgroundColor="Gray" VerticalOptions="Center" HorizontalOptions="FillAndExpand"/>
                    <Label Grid.Column="1" Text="Today's scripture" FontAttributes="Bold" HorizontalTextAlignment="Center"/>
                    <BoxView Grid.Column="2" WidthRequest="1" HeightRequest="1" BackgroundColor="Gray" VerticalOptions="Center" HorizontalOptions="FillAndExpand"/>
                </Grid>
            </StackLayout>
    
    

    Here is running screenshot.

Sign In or Register to comment.