TKCoreLayout Protocol Reference
Conforms to | NSObject |
Declared in | TKCoreLayout.h |
Tasks
-
– measure:
required method -
– arrange:
required method -
alignmentMode
property -
stretchMode
property -
– itemWasRemoved
-
– itemWasAddedInLayout:
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