Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 792 Bytes

layoutoptions.md

File metadata and controls

31 lines (25 loc) · 792 Bytes

Layout options

In Sharp.UI, you can layout every view in their container using the following extension methods:

  • CenterHorizontally
  • CenterVertically
  • Center
  • AlignStart
  • AlignEnd
  • AlignTop
  • AlignTopStart
  • AlignTopEnd
  • AlignBottom
  • AlignBottomStart
  • AlignBottomEnd
  • FillHorizontally
  • FillVertically
  • FillBothDirections

Usage

To use the layout options, create a container view (such as HStack or VStack), add the view you want to layout to the container, and call the desired method:

new VStack
{
    new Label("Hello, World!").Center()
}

This example centers a Label inside a VStack container. You can use the same method with other container views, and with any view that you want to lay out within its containing element.