This repository was archived by the owner on Feb 2, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747- (NSAttributedString * _Nullable)attributedTitleForState : (ASControlState)state ;
4848
4949/* *
50- * Sets the styled title to use for the specified state.
50+ * Sets the styled title to use for the specified state. This will reset styled title previously set with -setTitle:withFont:withColor:forState.
5151 *
5252 * @param title The styled text string to use for the title.
5353 * @param state The state that uses the specified title. The possible values are described in ASControlState.
5454 */
5555- (void )setAttributedTitle : (nullable NSAttributedString *)title forState : (ASControlState)state ;
5656
5757/* *
58- * Sets the title to use for the specified state.
58+ * Sets the title to use for the specified state. This will reset styled title previously set with -setAttributedTitle:forState.
5959 *
6060 * @param title The styled text string to use for the title.
6161 * @param font The font to use for the title.
Original file line number Diff line number Diff line change @@ -48,7 +48,12 @@ - (instancetype)init
4848 _titleNode = [[ASTextNode alloc ] init ];
4949 _imageNode = [[ASImageNode alloc ] init ];
5050 _backgroundImageNode = [[ASImageNode alloc ] init ];
51+ [_backgroundImageNode setContentMode: UIViewContentModeScaleToFill];
5152
53+ [_titleNode setLayerBacked: YES ];
54+ [_imageNode setLayerBacked: YES ];
55+ [_backgroundImageNode setLayerBacked: YES ];
56+
5257 _contentHorizontalAlignment = ASAlignmentMiddle;
5358 _contentVerticalAlignment = ASAlignmentCenter;
5459
@@ -59,6 +64,12 @@ - (instancetype)init
5964 return self;
6065}
6166
67+ - (void )setLayerBacked : (BOOL )layerBacked
68+ {
69+ ASDisplayNodeAssert (!layerBacked, @" ASButtonNode must not be layer backed!" );
70+ [super setLayerBacked: layerBacked];
71+ }
72+
6273- (void )setEnabled : (BOOL )enabled
6374{
6475 [super setEnabled: enabled];
You can’t perform that action at this time.
0 commit comments