anyuianyui
Home
Getting Started
Documentation
Download
Feedback
  • English
  • 简体中文
Home
Getting Started
Documentation
Download
Feedback
  • English
  • 简体中文
  • Setup

    • Installation
  • Core Concepts

    • Introduction
    • Design
    • Hide and Lock
    • Resource Management
    • Flag and State
  • Higher Order Component

    • State Button
    • Label Slider
    • Value Slider
    • Check Group & Radio Group
    • StatusBar
    • NavigateBar
    • Drawer
  • Animation

    • Widget Animation
    • Screen Load Animation
    • GIF Animated Image
    • Lottie Animation
  • Advanced Features

    • Layout
    • Use External Image File as Source
    • Template Component
    • Global Components
    • Screen Management
    • Communication Commands and Events
  • Development

    • Build Mode
    • Code Transplant
  • Technical Support

    • FAQ

Layout

Flex Layout

Flex Layout is a powerful layout system that enables the creation of flexible and responsive user interfaces.

To implement a flex layout, utilize the Container component and configure its properties. When combined with percentage-based sizing, padding, and nested Container components, you can construct sophisticated flex layouts.

Flex Layout Configuration Steps:

  1. Create a Container component
  2. Set the layout property to flex
  3. Configure flex flow, main align, track align properties
  4. Add padding row/column to adjust space between children
  5. Use percentage-based sizing to ensure children components adapt to the container size
  6. If the children have fixed size, then you can set size of Container to Auto to fit in content

flex layout

Flex Layout Example

The following example demonstrates a flex layout implementation using nested Container components.

Buttons, dropdowns, and checkboxes are automatically centered within the container without requiring explicit position settings.

flex layout example

Next
Use External Image File as Source