Add support to image alignment in ASButtonNode (#2266)

This commit is contained in:
Rocir Santiago
2016-09-19 17:16:49 -07:00
committed by Michael Schneider
parent 3e5b8c3096
commit 5990376f68
2 changed files with 21 additions and 1 deletions

View File

@@ -11,6 +11,16 @@
#import <AsyncDisplayKit/ASTextNode.h>
#import <AsyncDisplayKit/ASImageNode.h>
/**
Image alignment defines where the image will be placed relative to the text.
*/
typedef NS_ENUM(NSInteger, ASButtonNodeImageAlignment) {
/** Places the image before the text. */
ASButtonNodeImageAlignmentBeginning = 0,
/** Places the image after the text. */
ASButtonNodeImageAlignmentEnd = 1 << 0
};
@interface ASButtonNode : ASControlNode
@property (nonatomic, readonly) ASTextNode * _Nonnull titleNode;
@@ -44,6 +54,11 @@
*/
@property (nonatomic, assign) UIEdgeInsets contentEdgeInsets;
/**
* @discusstion Whether the image should be aligned at the beginning or at the end of node. Default is `ASButtonNodeImageAlignmentBeginning`.
*/
@property (nonatomic, assign) ASButtonNodeImageAlignment imageAlignment;
/**
* Returns the styled title associated with the specified state.
*