Forum Xamarin.Forms

How can I customize the border of stack Layout?

SuperCDSuperCD USMember ✭✭

I have created a square blocks using stack layout and have some elements inside the stack layout and now i want to customize the border color of stack layout? Can anybody let me know how can i create custom renderer for stack layout?

Best Answers


  • SuperCDSuperCD USMember ✭✭
    edited December 2015

    @adamkemp: Frame has rounded corners i need to show square. How can i get rid of frame's rounded corner ? Do i need to write custom renderer, if yes then please let me know how can i do that?

  • SuperCDSuperCD USMember ✭✭

    @adamkemp : Any sample would help ?

  • AlpeshAlpesh USMember

    StackLayout Content_stacklayout = new StackLayout
    Spacing = 0, //// important
    Children = { titleGrid,
    new BoxView { HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.Gray, HeightRequest = 2 }, //// Important - I used box view to draw border.
    scrollContent },
    BackgroundColor = Color.FromRgb(39, 170, 226),

  • HabibAli_SubhanHabibAli_Subhan PKMember ✭✭
    edited January 2017

    For windows, You can simply write in StackLayoutRenderer

    var border = new Border();
    border.BorderBrush = layout.BorderColor.ToBrush();
    border.BorderThickness = new Thickness(layout.BorderWidth);

    border.Child = this.Control;

  • MukeshKumar.3417MukeshKumar.3417 USMember ✭✭

    Hello Guys,

    I am using stack layout for left menu. I want to set image in layout background using custom render. Please suggest me that how will i achieve this in app or if you have any suggestion. You can share with me

  • Prajakta.ShindePrajakta.Shinde INUniversity ✭✭✭
    edited June 2017

    How can I add stack layout inside the frame programmatically?

  • adamkempadamkemp USInsider, Developer Group Leader mod

    Just set the Content property to your StackLayout. Here is the documentation:

  • Prajakta.ShindePrajakta.Shinde INUniversity ✭✭✭

    @adamkemp Thanks . I got that solution before.

  • VenkataSwamyVenkataSwamy INMember ✭✭✭


    You can set rounded corner for any Layout or View or Cell (StackLayout, Grid, ListView)

  • DhruvKanojiaDhruvKanojia USMember ✭✭

    Update, if any one stumbles upon this thread. There's a functionality now to handle where this mage goes in your Xamarin Forms Buttons.

    Documentation :

    Implementation :

Sign In or Register to comment.