From 5379511eaf89c678303b2298315bbc9f5a35fd5d Mon Sep 17 00:00:00 2001
From: Website Deployment Script
This is an API that works both on
alerts. To show an alert that prompts the user to enter some information,
see AlertIOS; entering text in an alert is common on iOS only.
On iOS you can specify any number of buttons. Each button can optionally specify a style, which is one of 'default', 'cancel' or 'destructive'.
On Android at most three buttons can be specified. Android has a concept -of a neutral, negative and a positive button:
Note that by default alerts on Android can be dismissed by clicking outside of their alert box.
-To prevent this behavior, you can provide
-an optional options parameter { cancelable: false } to the Alert method.
Example usage:
By default alerts on Android can be dismissed by tapping outside of the alert
+box. This event can be handled by providing an optional options parameter,
+with an onDismiss callback property { onDismiss: () => {} }.
Alternatively, the dismissing behavior can be disabled altogether by providing
+an optional options parameter with the cancelable property set to false
+i.e. { cancelable: false }
Example usage:
In the example we have a FlexibleSizeExampleView view that holds a root view. We create the root view, initialize it and set the delegate. The delegate will handle size updates. Then, we set the root view's size flexibility to RCTRootViewSizeFlexibilityHeight, which means that rootViewDidChangeIntrinsicSize: method will be called every time the React Native content changes its height. Finally, we set the root view's width and position. Note that we set there height as well, but it has no effect as we made the height RN-dependent.
You can checkout full source code of the example here.
It's fine to change root view's size flexibility mode dynamically. Changing flexibility mode of a root view will schedule a layout recalculation and the delegate rootViewDidChangeIntrinsicSize: method will be called once the content size is known.
Note: React Native layout calculation is performed on a special thread, while native UI view updates are done on the main thread. This may cause temporary UI inconsistencies between native and React Native. This is a known problem and our team is working on synchronizing UI updates coming from different sources.
Note: React Native does not perform any layout calculations until the root view becomes a subview of some other views. If you want to hide React Native view until its dimensions are known, add the root view as a subview and make it initially hidden (use
UIView'shiddenproperty). Then change its visibility in the delegate method.
You can edit the content above on GitHub and send us a pull request!
A wrapper for making views respond properly to touches. On press down, the opacity of the wrapped view is decreased, which allows -the underlay color to show through, darkening or tinting the view. The -underlay comes from adding a view to the view hierarchy, which can sometimes -cause unwanted visual artifacts if not used correctly, for example if the -backgroundColor of the wrapped view isn't explicitly set to an opaque color.
Example:
The underlay comes from wrapping the child in a new View, which can affect +layout, and sometimes cause unwanted visual artifacts if not used correctly, +for example if the backgroundColor of the wrapped view isn't explicitly set +to an opaque color.
TouchableHighlight must have one child (not zero or more than one). +If you wish to have several child components, wrap them in a View.
Example:
NOTE: TouchableHighlight must have one child (not zero or more than one)
If you wish to have several child components, wrap them in a View.
Determines what the opacity of the wrapped view should be when touch is +},
Determines what the opacity of the wrapped view should be when touch is active.
Called immediately after the underlay is hidden
Called immediately after the underlay is shown
(Apple TV only) TV preferred focus (see documentation for the View component).
(Apple TV only) Object with properties to control Apple TV parallax effects.
enabled: If true, parallax effects are enabled. Defaults to true. shiftDistanceX: Defaults to 2.0. diff --git a/releases/next/docs/touchablenativefeedback.html b/releases/next/docs/touchablenativefeedback.html index 4cae82e3c9d..94ff703bd88 100644 --- a/releases/next/docs/touchablenativefeedback.html +++ b/releases/next/docs/touchablenativefeedback.html @@ -1,8 +1,8 @@
A wrapper for making views respond properly to touches (Android only). On Android this component uses native state drawable to display touch -feedback. At the moment it only supports having a single View instance as a -child node, as it's implemented by replacing that View with another instance -of RCTView node with some additional properties set.
Background drawable of native feedback touchable can be customized with +feedback.
At the moment it only supports having a single View instance as a child +node, as it's implemented by replacing that View with another instance of +RCTView node with some additional properties set.
Background drawable of native feedback touchable can be customized with
background property.
Example:
A wrapper for making views respond properly to touches. -On press down, the opacity of the wrapped view is decreased, dimming it. -This is done without actually changing the view hierarchy, and in general is -easy to add to an app without weird side-effects.
Example:
Opacity is controlled by wrapping the children in an Animated.View, which is +added to the view hiearchy. Be aware that this can affect layout.
Example:
Do not use unless you have a very good reason. All the elements that -respond to press should have a visual feedback when touched.
NOTE: TouchableWithoutFeedback supports only one child
If you wish to have several child components, wrap them in a View.
Delay in ms, from onPressIn, before onLongPress is called.
Delay in ms, from the start of the touch, before onPressIn is called.
Delay in ms, from the release of the touch, before onPressOut is called.
If true, disable all interactions for this component.
This defines how far your touch can start away from the button. This is +respond to press should have a visual feedback when touched.
TouchableWithoutFeedback supports only one child. +If you wish to have several child components, wrap them in a View.
Delay in ms, from onPressIn, before onLongPress is called.
Delay in ms, from the start of the touch, before onPressIn is called.
Delay in ms, from the release of the touch, before onPressOut is called.
If true, disable all interactions for this component.
This defines how far your touch can start away from the button. This is
added to pressRetentionOffset when moving off of the button.
NOTE
The touch area never extends past the parent view bounds and the Z-index
diff --git a/releases/next/docs/using-a-listview.html b/releases/next/docs/using-a-listview.html
index 5c494cdb308..a9fa68aae4d 100644
--- a/releases/next/docs/using-a-listview.html
+++ b/releases/next/docs/using-a-listview.html
@@ -1,4 +1,4 @@
-
The ListView component displays a vertically scrolling list of changing, but similarly structured, data.
ListView works well for long lists of data, where the number of items might change over time. Unlike the more generic ScrollView, the ListView only renders elements that are currently showing on the screen, not all the elements at once.
The ListView component requires two props: dataSource and renderRow. dataSource is the source of information for the list. renderRow takes one item from the source and returns a formatted component to render.
This example creates a simple ListView of hardcoded data. It first initializes the dataSource that will be used to populate the ListView. Each item in the dataSource is then rendered as a Text component. Finally it renders the ListView and all Text components.
A
rowHasChangedfunction is required to useListView. Here we just say a row has changed if the row we are on is not the same as the previous row.
The ListView component displays a scrolling list of changing, but similarly structured, data.
ListView works well for long lists of data, where the number of items might change over time. Unlike the more generic ScrollView, the ListView only renders elements that are currently showing on the screen, not all the elements at once.
The ListView component requires two props: dataSource and renderRow. dataSource is the source of information for the list. renderRow takes one item from the source and returns a formatted component to render.
This example creates a simple ListView of hardcoded data. It first initializes the dataSource that will be used to populate the ListView. Each item in the dataSource is then rendered as a Text component. Finally it renders the ListView and all Text components.
A
rowHasChangedfunction is required to useListView. Here we just say a row has changed if the row we are on is not the same as the previous row.