ASButtonNode Class Reference
Inherits from | ASControlNode : ASDisplayNode : ASDealloc2MainObject |
---|---|
Declared in | ASButtonNode.h |
contentSpacing
Spacing between image and title. Defaults to 8.0.
@property (nonatomic, assign) CGFloat contentSpacing
Declared In
ASButtonNode.h
laysOutHorizontally
Whether button should be laid out vertically (image on top of text) or horizontally (image to the left of text). ASButton node does not yet support RTL but it should be fairly easy to implement. Defaults to YES.
@property (nonatomic, assign) BOOL laysOutHorizontally
Declared In
ASButtonNode.h
contentHorizontalAlignment
Horizontally align content (text or image). Defaults to ASHorizontalAlignmentMiddle.
@property (nonatomic, assign) ASHorizontalAlignment contentHorizontalAlignment
Declared In
ASButtonNode.h
contentVerticalAlignment
Vertically align content (text or image). Defaults to ASVerticalAlignmentCenter.
@property (nonatomic, assign) ASVerticalAlignment contentVerticalAlignment
Declared In
ASButtonNode.h
contentEdgeInsets
The insets used around the title and image node
@property (nonatomic, assign) UIEdgeInsets contentEdgeInsets
Discussion
The insets used around the title and image node
Declared In
ASButtonNode.h
imageAlignment
@discusstion Whether the image should be aligned at the beginning or at the end of node. Default is ASButtonNodeImageAlignmentBeginning
.
@property (nonatomic, assign) ASButtonNodeImageAlignment imageAlignment
Declared In
ASButtonNode.h
– attributedTitleForState:
Returns the styled title associated with the specified state.
- (NSAttributedString *_Nullable)attributedTitleForState:(ASControlState)state
Parameters
state |
The state that uses the styled title. The possible values are described in ASControlState. |
---|
Return Value
The title for the specified state.
Declared In
ASButtonNode.h
– setAttributedTitle:forState:
Sets the styled title to use for the specified state. This will reset styled title previously set with -setTitle:withFont:withColor:forState.
- (void)setAttributedTitle:(nullable NSAttributedString *)title forState:(ASControlState)state
Parameters
title |
The styled text string to use for the title. |
---|---|
state |
The state that uses the specified title. The possible values are described in ASControlState. |
Declared In
ASButtonNode.h
– setTitle:withFont:withColor:forState:
Sets the title to use for the specified state. This will reset styled title previously set with -setAttributedTitle:forState.
- (void)setTitle:(NSString *)title withFont:(nullable UIFont *)font withColor:(nullable UIColor *)color forState:(ASControlState)state
Parameters
title |
The styled text string to use for the title. |
---|---|
font |
The font to use for the title. |
color |
The color to use for the title. |
state |
The state that uses the specified title. The possible values are described in ASControlState. |
Declared In
ASButtonNode.h
– imageForState:
Returns the image used for a button state.
- (nullable UIImage *)imageForState:(ASControlState)state
Parameters
state |
The state that uses the image. Possible values are described in ASControlState. |
---|
Return Value
The image used for the specified state.
Declared In
ASButtonNode.h
– setImage:forState:
Sets the image to use for the specified state.
- (void)setImage:(nullable UIImage *)image forState:(ASControlState)state
Parameters
image |
The image to use for the specified state. |
---|---|
state |
The state that uses the specified title. The values are described in ASControlState. |
Declared In
ASButtonNode.h
– setBackgroundImage:forState:
Sets the background image to use for the specified state.
- (void)setBackgroundImage:(nullable UIImage *)image forState:(ASControlState)state
Parameters
image |
The image to use for the specified state. |
---|---|
state |
The state that uses the specified title. The values are described in ASControlState. |
Declared In
ASButtonNode.h
– backgroundImageForState:
Returns the background image used for a button state.
- (nullable UIImage *)backgroundImageForState:(ASControlState)state
Parameters
state |
The state that uses the image. Possible values are described in ASControlState. |
---|
Return Value
The background image used for the specified state.
Declared In
ASButtonNode.h