ASRelativeLayoutSpec Class Reference

Inherits from ASLayoutSpec : NSObject
Declared in ASRelativeLayoutSpec.h

Overview

Lays out a single layoutElement child and positions it within the layout bounds according to vertical and horizontal positional specifiers. Can position the child at any of the 4 corners, or the middle of any of the 4 edges, as well as the center - similar to “9-part” image areas.

+ relativePositionLayoutSpecWithHorizontalPosition:verticalPosition:sizingOption:child:

convenience constructor for a ASRelativeLayoutSpec

+ (instancetype)relativePositionLayoutSpecWithHorizontalPosition:(ASRelativeLayoutSpecPosition)horizontalPosition verticalPosition:(ASRelativeLayoutSpecPosition)verticalPosition sizingOption:(ASRelativeLayoutSpecSizingOption)sizingOption child:(id<ASLayoutElement>)child

Parameters

horizontalPosition

how to position the item on the horizontal (x) axis

verticalPosition

how to position the item on the vertical (y) axis

sizingOption

how much size to take up

child

the child to layout

Return Value

a configured ASRelativeLayoutSpec

Discussion

convenience constructor for a ASRelativeLayoutSpec

Declared In

ASRelativeLayoutSpec.h

– initWithHorizontalPosition:verticalPosition:sizingOption:child:

convenience initializer for a ASRelativeLayoutSpec

- (instancetype)initWithHorizontalPosition:(ASRelativeLayoutSpecPosition)horizontalPosition verticalPosition:(ASRelativeLayoutSpecPosition)verticalPosition sizingOption:(ASRelativeLayoutSpecSizingOption)sizingOption child:(id<ASLayoutElement>)child

Parameters

horizontalPosition

how to position the item on the horizontal (x) axis

verticalPosition

how to position the item on the vertical (y) axis

sizingOption

how much size to take up

child

the child to layout

Return Value

a configured ASRelativeLayoutSpec

Discussion

convenience initializer for a ASRelativeLayoutSpec

Declared In

ASRelativeLayoutSpec.h