9.1 KiB
id, title, original_id
| id | title | original_id |
|---|---|---|
| version-0.50-viewpagerandroid | viewpagerandroid | viewpagerandroid |
ViewPagerAndroid #
Container that allows to flip left and right between child views. Each
child view of the ViewPagerAndroid will be treated as a separate page
and will be stretched to fill the ViewPagerAndroid.
It is important all children are <View>s and not composite components.
You can set style properties like padding or backgroundColor for each
child.
Example:
...
var styles = { ... viewPager: { flex: 1 }, pageStyle: { alignItems: 'center', padding: 20, } }
Props #
initialPage?: number #
Index of initial page that should be selected. Use setPage method to
update the page, and onPageSelected to monitor page changes
keyboardDismissMode?: enum('none', 'on-drag') #
Determines whether the keyboard gets dismissed in response to a drag.
- 'none' (the default), drags do not dismiss the keyboard.
- 'on-drag', the keyboard is dismissed when a drag begins.
onPageScroll?: function #
Executed when transitioning between pages (ether because of animation for
the requested page change or when user is swiping/dragging between pages)
The event.nativeEvent object for this callback will carry following data:
onPageScrollStateChanged?: function #
Function called when the page scrolling state has changed. The page scrolling state can be in 3 states:
onPageSelected?: function #
This callback will be called once ViewPager finish navigating to selected page
(when user swipes between pages). The event.nativeEvent object passed to this
callback will have following fields:
pageMargin?: number #
Blank space to show between pages. This is only visible while scrolling, pages are still edge-to-edge.
peekEnabled?: bool #
Whether enable showing peekFraction or not. If this is true, the preview of last and next page will show in current screen. Defaults to false.
scrollEnabled?: bool #
When false, the content does not scroll. The default value is true.
Type Definitions #
Improve this page by sending a pull request!