Viewpagerandroid of RN Components

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.