linear-weight

Introduction

Child element's weight in linear. The parent container automatically allocates the length of the corresponding side of the child elements according to the weight value ratio of all child elements and the size of the remaining space.

Examples

Syntax

linear-weight: 3;
linear-weight: 5;

Values

  • <number>

    Negative values are invalid. Default value is 0. When the linear-weight of a sub-element in linear layout is 0, the layout of the child element will not be affected by the linear-weight.

Formal definition

Initial value0
Applies tolinear items
Inheritedno
Animatable

Formal syntax

linear-weight = <number>

Difference between web

  • No such style in Web.

Compatibility

LCD tables only load in the browser

FAQ

  • It is not supported to use a fixed value and weight at the same time. If there is a weight, the fixed value is automatically ignored (performance first).
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.