TKCoreStackLayout Class Reference
Inherits from | NSObject |
Conforms to | NSFastEnumeration TKCoreLayout |
Declared in | TKCoreStackLayout.h |
Tasks
-
orientation
property -
itemOrder
property -
itemSpacing
property -
alignmentMode
property -
stretchMode
property -
count
property -
items
property -
– addItem:
-
– insertItem:atIndex:
-
– removeItem:
-
– removeItemAtIndex:
-
– removeAllItems
-
– itemAtIndex:
-
– indexOfItem:
-
– lastItem
Properties
alignmentMode
The alignment mode that will be used when arranging the view.
@property TKCoreLayoutAlignmentMode alignmentMode
Declared In
TKCoreStackLayout.h
count
The items count.
@property (nonatomic, readonly) NSInteger count
Return Value
The items count.
Declared In
TKCoreStackLayout.h
itemOrder
The layout order. It can be normal or reversed.
@property (nonatomic, assign) TKCoreStackLayoutItemOrder itemOrder
Discussion
The stack layout item orders are defined as follows:
typedef enum {
TKCoreStackLayoutItemOrderNormal, // Items should be arranged in the same order they are added in the stack.
TKCoreStackLayoutItemOrderReverse // Items should be arranged in reverse order.
} TKCoreStackLayoutItemOrder;
Declared In
TKCoreStackLayout.h
itemSpacing
A value that defines the spacing between the subviews.
@property (nonatomic, assign) CGFloat itemSpacing
Declared In
TKCoreStackLayout.h
items
The stack items.
@property (nonatomic, strong, readonly) NSArray *items
Declared In
TKCoreStackLayout.h
orientation
The layout orientation. It can be horizontal or vertical.
@property (nonatomic, assign) TKCoreStackLayoutOrientation orientation
Discussion
The stack layout orientations are defined as follows:
typedef enum {
TKCoreStackLayoutOrientationHorizontal, // Items should be arranged horizontally.
TKCoreStackLayoutOrientationVertical // Items should be arranged vertically.
} TKCoreStackLayoutOrientation;
Declared In
TKCoreStackLayout.h
Instance Methods
addItem:
Adds a new stack layout item to the stack. This method does not add a subview to a superview. The developer should do this explicitly.
- (BOOL)addItem:(id<TKCoreLayout>)item
Parameters
- item
The item to be added.
Return Value
YES if successfull.
Declared In
TKCoreStackLayout.h
indexOfItem:
Gets the index of specific item.
- (NSInteger)indexOfItem:(id<TKCoreLayout>)layoutItem
Parameters
- layoutItem
The item.
Return Value
The item index if successfull.
Declared In
TKCoreStackLayout.h
insertItem:atIndex:
Inserts a new item at a specified position in the stack. This method does not add a subview to a superview. The developer should do this explicitly.
- (BOOL)insertItem:(id<TKCoreLayout>)item atIndex:(NSUInteger)index
Parameters
- item
The item to be inserted.
- index
The index at which the item will be inserted.
Return Value
YES if successfull.
Declared In
TKCoreStackLayout.h
itemAtIndex:
Gets an item at a specific index.
- (id<TKCoreLayout>)itemAtIndex:(NSUInteger)index
Parameters
- index
The index of the item.
Return Value
An instance of TKCoreStackLayoutItem if successfull.
Declared In
TKCoreStackLayout.h
lastItem
The last item in the layout
- (id<TKCoreLayout>)lastItem
Return Value
The last item in the layout
Declared In
TKCoreStackLayout.h
removeAllItems
Removes all items from the stack. This method does not remove subviews from their superview.
- (void)removeAllItems
Declared In
TKCoreStackLayout.h