FMX.Layouts.TFlowLayout

From RAD Studio API Documentation
Jump to: navigation, search

FMX.Controls.TControlFMX.Types.TFmxObjectSystem.Classes.TComponentSystem.Classes.TPersistentSystem.TObjectTFlowLayout

Delphi

TFlowLayout = class(TControl, IContentObserver)

C++

class PASCALIMPLEMENTATION TFlowLayout : public Fmx::Controls::TControl

Properties

Type Visibility Source Unit Parent
class public
FMX.Layouts.pas
FMX.Layouts.hpp
FMX.Layouts FMX.Layouts

Description

A control that arranges its child controls as if they were words in a paragraph.

The children of a TFlowLayout are lined one by one. When the Width of the layout is exceeded, the remaining child controls are wrapped to the next line and so on until all of the controls are placed. To add a line break, like in a normal text, add a TFlowLayoutBreak to the current TFlowLayout.

The direction of the controls flow can be from left to right or from right to left. To change the direction, set the FlowDirection property. Changing the direction does not change the line of the control, only the order of the controls on each line.

The distance between controls from the same line and the distance between lines can be customized by setting the HorizontalGap and VerticalGap properties.

The TFlowLayout children can be aligned as words in a paragraph: left, right, center, or justified. The alignment can be customized through the Justify property. The alignment of the last line within the layout is treated separately, and can be set through the JustifyLastLine property. If there is a single line, Justify has no effect, the line is treated as a last line, and is aligned according to JustifyLastLine.

Note: The Align property of the controls within a TFlowLayout is ignored. The Position property for child controls is automatically set, and explicitly changing its value has no effect.

The TFlowLayout can be used to obtain this kind of results:

FlowLayout.png FlowLayout center.png

See Also