Which platforms support scrollviews




















Vertical Boolean value, whether vertical scroll is allowed or not. Inertia Is there an accelerating velocity when scrolling Brake Floating point number, the deceleration coefficient after scrolling. The value range is where if set to 1, then the scroll will stop immediately; if set to 0, then the scroll will continue until the content border. Elastic Boolean value, whether to bounce back or not. Bounce Duration Floating point number, the time duration for bounce back.

The value range is Horizontal ScrollBar A reference node for creating a scroll bar showing the horizontal position of the contents. Vertical ScrollBar A reference node for creating a scroll bar showing vertical position of the contents.

ScrollView Events Default list type is null. Each event added by the user is composed of the node reference, component name and a response function. Please see the ScrollView Event section below for details. Component Script component name. Handler Assign a callback function which will be triggered when the scrollview events emitted. ScrollBar settings ScrollBar is optional. Detailed explanation The ScrollView component can only work with the specified content node. On the other hand, this has a performance downside.

Imagine you have a very long list of items you want to display, maybe several screens worth of content. Creating JS components and native views for everything all at once, much of which may not even be shown, will contribute to slow rendering and increased memory usage. This is where FlatList comes into play. FlatList renders items lazily, just when they are about to appear, and removes items that scroll way off screen to save memory and processing time.

FlatList is also handy if you want to render separators between your items, multiple columns, infinite scroll loading, or any number of other features it supports out of the box. When true, the scroll view bounces vertically when it reaches the end even if the content is smaller than the scroll view itself. These styles will be applied to the scroll view content container which wraps all of the child views. Handler function is passed the content width and content height as parameters: contentWidth, contentHeight.

It's implemented using onLayout handler attached to the content container which this ScrollView renders. Fires at most once per frame during scrolling. The frequency of the events can be controlled using the scrollEventThrottle prop.

When true, the scroll view stops on multiples of the scroll view's size when scrolling. This can be used for horizontal pagination. The default value is false. A RefreshControl component, used to provide pull-to-refresh functionality for the ScrollView. Only works for vertical ScrollViews horizontal prop must be false. Experimental: When true, offscreen child views whose overflow value is hidden are removed from their native backing superview when offscreen.

This can improve scrolling performance on long lists. The default value is true. An array of child indices determining which children get docked to the top of the screen when scrolling. Sometimes a scrollview takes up more space than its content fills.

When this is the case, this prop will fill the rest of the scrollview with a color to avoid setting a background and creating unnecessary overdraw. This is an advanced optimization that is not needed in the general case. Tag used to log scroll performance on this scroll view. Will force momentum events to be turned on see sendMomentumEvents. This doesn't do anything out of the box and you need to implement a custom native FpsListener for it to be useful.

When true, ScrollView will emit updateChildFrames data in scroll events, otherwise will not compute or emit child frame data. This only exists to support legacy issues, onLayout should be used instead to retrieve frame data. When true, the scroll view bounces horizontally when it reaches the end even if the content is smaller than the scroll view itself. When true, the scroll view's children are arranged horizontally in a row instead of vertically in a column.

When this is the case, this prop will fill the rest of the scrollview with a color to avoid setting a background and creating unnecessary overdraw. This is an advanced optimization that is not needed in the general case. If the value is greater than 0 , the fading edges will be set accordingly to the current scroll direction and position, indicating if there is more content to show. When true , the scroll view's children are arranged horizontally in a row instead of vertically in a column.

If sticky headers should stick at the bottom instead of the top of the ScrollView. This is usually used with inverted ScrollViews. When set, the scroll view will adjust the scroll position so that the first child that is currently visible and at or beyond minIndexForVisible will not change position.

This is useful for lists that are loading content in both directions, e. A value of 0 is common, but other values such as 1 can be used to skip loading spinners or other content that should not maintain position. The optional autoscrollToTopThreshold can be used to make the content automatically scroll to the top after making the adjustment if the user was within the threshold of the top before the adjustment was made. This is also useful for chat-like applications where you want to see new messages scroll into place, but not if the user has scrolled up a ways and it would be disruptive to scroll a bunch.

Caveat 1: Reordering elements in the scrollview with this enabled will probably cause jumpiness and jank. It can be fixed, but there are currently no plans to do so. For now, don't re-order the content of any ScrollViews or Lists that use this feature.

Caveat 2: This uses contentOffset and frame. Occlusion, transforms, and other complexity won't be taken into account as to whether content is "visible" or not. Handler function is passed the content width and content height as parameters: contentWidth, contentHeight. It's implemented using onLayout handler attached to the content container which this ScrollView renders. Fires at most once per frame during scrolling. The frequency of the events can be controlled using the scrollEventThrottle prop.

The event has the following shape all values are numbers :. When true, the scroll view stops on multiples of the scroll view's size when scrolling. This can be used for horizontal pagination. A RefreshControl component, used to provide pull-to-refresh functionality for the ScrollView. Only works for vertical ScrollViews horizontal prop must be false.

Experimental: When true , offscreen child views whose overflow value is hidden are removed from their native backing superview when offscreen.

This can improve scrolling performance on long lists. This controls how often the scroll event will be fired while scrolling as a time interval in ms. A lower number yields better accuracy for code that is tracking the scroll position, but can lead to scroll performance problems due to the volume of information being sent over the bridge. You will not notice a difference between values set between as the JS run loop is synced to the screen refresh rate.



0コメント

  • 1000 / 1000