style and typos
This commit is contained in:
parent
3686facdda
commit
87302ac74b
|
@ -7,7 +7,7 @@ permalink: docs/platform-specific-code.html
|
||||||
next: native-modules-ios
|
next: native-modules-ios
|
||||||
---
|
---
|
||||||
|
|
||||||
When building a cross platform app, the need to write different code for different platforms may arise. This can always be achieved by organizing the various components in different folders:
|
When building a cross-platform app, the need to write different code for different platforms may arise. This can always be achieved by organizing the various components in different folders:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
/common/components/
|
/common/components/
|
||||||
|
@ -49,13 +49,13 @@ A module is provided by React Native to detect what is the platform in which the
|
||||||
var {Platform} = React;
|
var {Platform} = React;
|
||||||
|
|
||||||
var styles = StyleSheet.create({
|
var styles = StyleSheet.create({
|
||||||
height: (Platform.OS === 'ios') ? 200 : 100
|
height: (Platform.OS === 'ios') ? 200 : 100,
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
`Platform.OS` will be `ios` when running in iOS and `android` when running in an Android device or simulator.
|
`Platform.OS` will be `ios` when running in iOS and `android` when running in an Android device or simulator.
|
||||||
|
|
||||||
###Detecting android version
|
###Detecting Android version
|
||||||
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
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
|
Loading…
Reference in New Issue