mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-02 08:41:52 +08:00
19 lines
814 B
Markdown
Executable File
19 lines
814 B
Markdown
Executable File
---
|
|
title: ASButtonNode
|
|
layout: docs
|
|
permalink: /docs/button-node.html
|
|
next: text-node.html
|
|
---
|
|
|
|
`ASButtonNode` (a subclass of `ASControlNode`) supports simple buttons, with multiple states for a text label and an image with a few different layout options. Enables layerBacking for subnodes to significantly lighten main thread impact relative to UIButton (though async preparation is the bigger win).
|
|
|
|
Features:
|
|
- supports state-changing background images
|
|
- supports state-changing titles
|
|
- supports text alignment
|
|
- supports contentEdgeInsets
|
|
- offers methods that allow more convenient usage than creating attributed strings — title NSString, UIFont, and UIColor.
|
|
|
|
Gotchas:
|
|
- the `selected` property logic should be handled by the developer. Tapping the ASButtonNode does not automatically enable selected.
|