mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-17 12:14:54 +08:00
Update placeholder-fade-duration.md
This commit is contained in:
@@ -6,6 +6,8 @@ prevPage: image-modification-block.html
|
||||
nextPage: layer-backing.html
|
||||
---
|
||||
|
||||
## ASDisplayNodes may Implement Placeholders
|
||||
|
||||
Any `ASDisplayNode` subclass may implement the `-placeholderImage` method to provide a placeholder that covers content until a node's contents are finished displaying. To use placeholders, set `.placeholderEnabled = YES` and optionally set a `.placeholderFadeDuration`;
|
||||
|
||||
For image drawing, use the node's `.calculatedSize` property.
|
||||
@@ -16,7 +18,11 @@ The <code>-placeholderImage</code> function may be called on a background thread
|
||||
|
||||
See our ancient <a href="https://github.com/facebook/AsyncDisplayKit/tree/master/examples_extra/placeholders">Placeholders sample app</a> to see this concept, first invented by the Facebook Paper team, in action.
|
||||
|
||||
## ASNetworkImageNode also has a Default Image
|
||||
## `.neverShowPlaceholders`
|
||||
|
||||
Hear <a href="https://youtu.be/RY_X7l1g79Q">Scott Goodson explain</a> placeholders, `.neverShowPlaceholders` and why UIKit doesn't have them.
|
||||
|
||||
## ASNetworkImageNode also have Default Images
|
||||
|
||||
In _addition_ to placeholders, `ASNetworkImageNode`s also have a `.defaultImage` property. While placeholders are meant to be transient, default images will persist if the image node's `.URL` property is `nil` or if the URL fails to load.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user