CKFlexboxComponent Class Reference

Inherits from CKLayoutComponent : CKComponent : NSObject
Declared in CKFlexboxComponent.h

Overview

@uidocs https://fburl.com/CKFlexboxComponent:ca56

A layout component that create a list of children vertically or horizontally according to Flexbox.

This component layout is powered by Yoga layout engine (https://github.com/facebook/yoga). You can find more details about Yoga properties and implementation here (https://yogalayout.com/docs/) Yoga playground (https://yogalayout.com/playground) allows you to experiment with different layout configurations and can generate CKFlexboxComponent code for you

+ newWithView:size:style:children:

A view configuration, or {} for no view.

+ (instancetype)newWithView:(const CKComponentViewConfiguration &)view size:(const CKComponentSize &)size style:(const CKFlexboxComponentStyle &)style children:(CKContainerWrapper<std::vector<CKFlexboxComponentChild> > & &)children

Parameters

view

A view configuration, or {} for no view.

size

A size, or {} for the default size.

style

Specifies how children are laid out.

children

A vector of children components.

Declared In

CKFlexboxComponent.h

+ newWithView:size:

A struct describing the view for this component. Pass {} to specify that no view should be created.

+ (instancetype)newWithView:(const CKComponentViewConfiguration &)view size:(const CKComponentSize &)size

Parameters

view

A struct describing the view for this component. Pass {} to specify that no view should be created.

size

A size constraint that should apply to this component. Pass {} to specify no size constraint.

@example A component that renders a red square: [CKComponent newWithView:{[UIView class], {{@selector(setBackgroundColor:), [UIColor redColor]}}} size:{100, 100}]

Declared In

CKComponent.h