I. viewpagerandroid
1. A container that allows pages to be left and right between the child views. Each Viewpagerandroid sub-container is treated as a separate page and will be stretched to fill
Viewpagerandroid. Note that all child views must be pure view, not custom composite containers. You can set style properties for each child view
such as padding or backgroundcolor.
2. Properties
Initialpage Number: The subscript of the initially selected page. You can use the Setpage function to page through pages and use onpageselected to listen for changes in the page.
Keyboraddismissmode enum (' None ', ' On-drag '): Determines whether to let the soft keyboard disappear while sliding.
None (default): Dragging does not make the keyboard disappear.
On-drag: The keyboard disappears when the drag is started.
Onpagescroll function: Executes when switching between pages, whether due to animation or user sliding/dragging between pages.
The Event.nativeevent object in the callback parameter contains the following data:
Position: The subscript for the first page of the current courseware from the left.
Offset: a range between [0,1] that represents the state of the current toggle. A value of x indicates that the page represented by "position" now has
(1-x) Part of the courseware, while the next page has an X section visible.
onpagescrollstatechanged function: This callback function is called when the page slide state changes. The page slide state may be one of the following three:
Idle: free, meaning there is currently no interaction
Dragging: dragging means that the current page is being dragged.
Settling: An animation that is in process that has interacted with the current page and is closing the beginning or ending.
onpageselected function: This callback is called after the page switch is complete (when the user slides between pages).
The Event.nativeevent object in the callback parameter contains the following fields:
Position: The currently selected page subscript.
Viewpagerandroid of RN Components