Adding a Scene to a Chapter or a Section Header
Add a scene to your article to create special effects.
- Apple News Format
- Apple News API
Apple News Format provides animations (see About Component Animations) and behaviors (see About Component Behaviors) to use with individual components in your article, but you can also use a scene—a combination of animations and behaviors—to control how a section or chapter of your article comes into view.
A scene combines animations and behaviors to create special effects that you can use with the headers in
chapter components. Apple News Format has two scenes you can use to add interest to your article:
FadingStickyHeader. Causes the header to briefly "stick" to the top of the screen and then fade to a defined color.
ParallaxScaleHeader. Causes the header to zoom out and scroll more slowly than the user is scrolling, giving the impression of a parallax effect.
To add a scene, do the following:
In the components array of your Section or Chapter, add a Header.
scene property of the section or chapter component, specify which scene you want to use (
parallax_scale). See the example code in FadingStickyHeader.
A combination of animations and behaviors to use in sections and chapters that have headers.
The scene that briefly keeps a header at the top of the screen as the user scrolls through the article.
The scene that gives the impression of a parallax effect by zooming out and scrolling slightly more slowly than the user’s action.
The component for defining the top area of an article, chapter, or section.
The component for setting apart content that is not directly related to the article, such as promotional content.
An object used in any container component type to define how the collection of child components is presented.
The component for defining a horizontal line to visually divide parts of your article.