Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Frame in Grid does not respond to HeightProperty

$
0
0

Hello

I am very new to Xamarin.Forms, so I apologize if this seems obvious. I have tried to search for an answer but I can't find one.

I am creating a UI with a few pages. One page is using a 3 x 9 Grid as it's root layout. In a certain position on the grid I want to place a box with rounded corners, in which I want a label to display some information.

I have created the box shape using a Frame, and set the CornerRadius property accordingly to obtain rounded corners. This is working just fine.

Now, I want to lower the height of the frame, which seems doable when I do not add the label. When I do add the label, the frame's height property seems to be ignored. I basically want the Frame to be squished in the height direction, so the Frame appears elongated.

This is the XAML for the Frame and the Label:

<br />        <Grid>
        ...
        <Frame 
                CornerRadius="30" 
                WidthRequest="100" 
                VerticalOptions="CenterAndExpand" 
                HorizontalOptions="CenterAndExpand"
                BackgroundColor="{StaticResource Grey}" 
                Grid.Row="6" 
                Grid.Column="1">
                    <StackLayout>
                            <Label
                                Text="Metro" 
                    HeightRequest="15" 
                    FontSize="14" Style="{StaticResource SoundScapeLabel}"/>
                    </StackLayout>
        </Frame>
        ...
    </Grid>

I have currently tried setting the Frame's HeightRequest to various values, which does not seem to affect the outcome. I have also tried to remove the Horizontal and Vertical options to no avail. I added the Stacklayout as a random effort to see if that had an effect, but no.

Any ideas?

Thank you!

Justa Haasbin


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>