Conforms to NSObject
Declared in TKCoreLayout.h

Overview

Represents layouting information used by layout managers

Properties

alignmentMode

The alignment mode that will be used when arranging the view.

@property TKCoreLayoutAlignmentMode alignmentMode

Discussion

The alignment modes are defined as follows:

typedef enum {
    TKCoreLayoutAlignmentModeLeft = 1,              // The subview should be aligned to the left.
    TKCoreLayoutAlignmentModeTop  = 2,              // The subview should be aligned to the right.
    TKCoreLayoutAlignmentModeRight = 4,             // The subview should be aligned to the top.
    TKCoreLayoutAlignmentModeBottom = 8,            // The subview should be aligned to the bottom.
    TKCoreLayoutAlignmentModeHorizontalCenter = 16, // The subview should be centered horizontally.
    TKCoreLayoutAlignmentModeVerticalCenter = 32    // The subview should be centered vertically.
} TKCoreLayoutAlignmentMode;

Declared In

TKCoreLayout.h

stretchMode

The streching mode that will be used when arranging the view.

@property TKCoreLayoutStretchMode stretchMode

Discussion

The stretch modes are defined as follows:

typedef enum {
    TKCoreLayoutStretchModeNone = 0,        // The subview should not stretch.
    TKCoreLayoutStretchModeHorizontal = 1,  // The subview should stretch horizontally and occupy the available area.
    TKCoreLayoutStretchModeVertical = 2     // The subview should stretch vertically and occupy the avaialable area.
} TKCoreLayoutStretchMode;

Declared In

TKCoreLayout.h

Instance Methods

arrange:

Lays out the item within the provided rectangle.

- (void)arrange:(CGRect)rect

Parameters

rect

The rectangle that is provided to this item for arrange.

Declared In

TKCoreLayout.h

itemWasAddedInLayout:

This method is being called when the item is added to a layout.

- (void)itemWasAddedInLayout:(id<TKCoreLayout>)layout

Parameters

layout

The layout to which this item is being added.

Declared In

TKCoreLayout.h

itemWasRemoved

This method is being called when the item is removed from its owner layout.

- (void)itemWasRemoved

Declared In

TKCoreLayout.h

measure:

Measures the size required by the layout item by using the provided size as a constraint.

- (CGSize)measure:(CGSize)size

Parameters

size

The available size that could be used when arranging this item.

Return Value

The desired size that is required by this item.

Declared In

TKCoreLayout.h