locked
Cutting Corners ---- possibly a frame bug? RRS feed

  • Question

  • User394320 posted

    Hi. I am having some trouble with borders. I want a gold border around my page and I want it to be 2 pixels thick.

    I originally did this with:

    [frame bordercolor='gold' cornerradius='12'] [frame bordercolor='gold' cornerradius='12'] [stacklayout] .............

    However the inner frame would be cut off slightly, so I then tried:

    [frame backgroundcolor='gold' padding='2' cornerradius='12'] [stacklayout]..........

    However, now the sharp corned stacklayout cuts all the way through the frame.

    So... a frame does not really seem to be a frame for making borders.

    How can I get a rounded 2 pixel frame all the way around my stacklayout without the corners being cut into by the stacklayout? ie. I want to stacklayout to honor the 2 pixel padding at the rounded corners of the frame. I also tried adding IsClippedToBounds="True" to the StackLayout, but that made no difference.

    Thank you.

    Wednesday, June 3, 2020 5:46 PM

All replies

  • User371688 posted

    now the sharp corned stacklayout cuts all the way through the frame

    Sorry ,I don't quite follow you. What do you mean by words now the sharp corned stacklayout cuts all the way through the frame. ?

    What exactly are you trying to achieve?

    According to your description,when I used the following code:

           <Frame BorderColor='gold' CornerRadius='12'>
            <Frame    BorderColor='gold' CornerRadius='12'>
                <StackLayout>
                    <!-- Place new controls here -->
                    <Label Text="Welcome to Xamarin.Forms!" 
               HorizontalOptions="Center"
               VerticalOptions="CenterAndExpand" />
                </StackLayout>
            </Frame>
        </Frame>
    

    The result is:

    When I used the following code:

    <Frame    BackgroundColor='gold' Padding='2'  CornerRadius='12'>
    <StackLayout>
    
        <Label Text="Welcome to Xamarin.Forms!" 
           HorizontalOptions="Center"
           VerticalOptions="CenterAndExpand" />
    </StackLayout>
    </Frame>
    

    The result is:

    Thursday, June 4, 2020 6:22 AM
  • User371688 posted

    Hi @hayedid, have you resolved your question?

    Monday, June 29, 2020 7:03 AM