diff --git a/releases/next/docs/platform-specific-code.html b/releases/next/docs/platform-specific-code.html index 60deafb2394..ada2cabe8a7 100644 --- a/releases/next/docs/platform-specific-code.html +++ b/releases/next/docs/platform-specific-code.html @@ -2,12 +2,12 @@ /android/components/ /ios/components/
Another option may be naming the components differently depending on the platform they are going to be used in:
But React Native provides two alternatives to easily organize your code separating it by platform:
React Native will detect when a file has a .ios. or .android. extension and load the right file for each platform when requiring them from other components.
For example, you can have these files in your project:
With this setup, you can just require the files from a different component without paying attention to the platform in which the app will run.
React Native will import the correct component for the running platform.
A module is provided by React Native to detect what is the platform in which the app is running. This piece of functionality can be useful when only small parts of a component are platform specific.
With this setup, you can just require the files from a different component without paying attention to the platform in which the app will run.
React Native will import the correct component for the running platform.
A module is provided by React Native to detect what is the platform in which the app is running. This piece of functionality can be useful when only small parts of a component are platform specific.
Platform.OS will be ios when running in iOS and android when running in an Android device or simulator.
There is also a Platform.select method available, that given an object containing Platform.OS as keys,
-returns the value for the platform you are currently running on.
Since it accepts any value, you can also use it t
android: () => require('ComponentAndroid'),
})();
-<Component />;
On Android, the Platform module can be also used to detect which is the version of the Android Platform in which the app is running
On Android, the Platform module can be also used to detect which is the version of the Android Platform in which the app is running
UIScrollViewDecelerationRateNormal and
scrolling while dragging. The default value is false.The style of the scroll indicators.
- default (the default), same as black.
- black, scroll indicator is black. This style is good against a white content background.
- - white, scroll indicator is white. This style is good against a black content background.
The maximum allowed zoom scale. The default value is 1.0.
The minimum allowed zoom scale. The default value is 1.0.
DeprecatedUse the refreshControl prop instead.
Called when a scrolling animation ends.
This controls how often the scroll event will be fired while scrolling
+ - white, scroll indicator is white. This style is good against a black content background.
The maximum allowed zoom scale. The default value is 1.0.
The minimum allowed zoom scale. The default value is 1.0.
Called when a scrolling animation ends.
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 send over the bridge.
@@ -92,7 +92,7 @@ with snapToAlignment.
The current scale of the scroll view content. The default value is 1.0.
Deprecated. Use RefreshControl instead.
Scrolls to a given x, y offset, either immediately or with a smooth animation.
Syntax:
scrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true})
Note: The weird argument signature is due to the fact that, for historical reasons,
+with horizontal={true}.
The current scale of the scroll view content. The default value is 1.0.
Scrolls to a given x, y offset, either immediately or with a smooth animation.
Syntax:
scrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true})
Note: The weird argument signature is due to the fact that, for historical reasons, the function also accepts separate arguments as as alternative to the options object. This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED.
Deprecated, do not use.
Examples # | Edit on GitHub |