Similar to the Facebook React Native ScrollView component, but refers directly to a CYIListView (not CYIScrollBarView) After Effects object. ScrollRef components can render both Compositions and Facebook React Native components; for an example, see You.i React Native Compositions.
Remember the following points when you use ScrollRef:
See also Understanding Lists.
import { ScrollRef } from '@youi/react-native-youi';
...
<ScrollRef
name="Component-List"
horizontal={true}
/>
name
After Effects layer name
Type | Required |
---|---|
String | Yes |
onContentSizeChange
Similar to onContentSizeChange prop of Facebook React Native ScrollView component.
onMomentumScrollBegin
Similar to onMomentumScrollBegin prop of Facebook React Native ScrollView component.
onMomentumScrollEnd
Similar to onMomentumScrollEnd prop of Facebook React Native ScrollView component.
onScroll
Similar to onScroll prop of Facebook React Native ScrollView component.
onCompositionDidLoad
Invoked when the parent composition is loaded successfully and the Ref component gets attached to it.
horizontal
Similar to horizontal prop of Facebook React Native ScrollView component.
You can set horizontal
using the following settings in After Effects:
In After Effects | (Scroll) |
---|---|
Scroll Horizontally | True |
Scroll in Both Directions | True |
Scroll Vertically | False |
Do Not Scroll | False |
The default value for horizontal
in After Effects is Scroll Horizontally.
scrollEventThrottle
Similar to scrollEventThrottle prop of Facebook React Native ScrollView component.
testID
A unique identifier for this element to be used in UI automation testing scripts.
Type | Required |
---|---|
string | No |
snapToAlignment
Similar to snapToAlignment prop of Facebook React Native ScrollView component.
You can set snapToAlignment
using the following settings in After Effects:
In After Effects | (Horizontal or Vertical Magnets) |
---|---|
Edges | None |
None | None |
Begin | Start |
End | End |
For example, to set snapToAlignment
as Start
for a vertically scrolling list, set Vertical Magnets to Begin.
Horizontal Magnets can remain unset.
See also Magnets.
snapToInterval
Similar to snapToInterval prop of Facebook React Native ScrollView component.
In After Effects, it can also be defined by the magnet’s offset value.
scrollEnabled
Similar to scrollEnabled prop of Facebook React Native ScrollView component.
You can set ScrollEnabled
using the following settings in After Effects:
In After Effects | (Scroll) |
---|---|
Do Not Scroll | False |
Scroll Horizontally | True |
Scroll Vertically | True |
Scroll in Both Directions | True |
stickyHeaderIndices
This prop mirrors Facebook React Native’s implementation, with some important caveats for sticky headers that are focusable.
Applies to vertically scrolling lists; not supported when horizontal={true}
.
Type | Required |
---|---|
Array | No |
scrollTo()
Similar to scrollTo() method of Facebook React Native ScrollView component.
scrollToEnd()
Similar to scrollToEnd() method of Facebook React Native ScrollView component.