Add standard: what differences between iOS and android should I be aware of#146
Add standard: what differences between iOS and android should I be aware of#146
Conversation
Automatic reviewerscc: @louiszawadzki, @tychota Generated by 🚫 dangerJS |
| While coding I usually use the iOS simulator only. Most of the time, if the feature works on iOS then it works on android automatically. Of course there are a few exceptions: in this article you will find a non comprehensive list of caveats. | ||
|
|
||
|
|
||
| ### I modified the native code |
There was a problem hiding this comment.
check : il y a une différence de commit dans le dossier android ou dossier ios
|
|
||
| - References: See [How to add a native module](https://github.com/bamlab/dev-standards/blob/master/react-native/setup/add-native-module.mo.md) | ||
|
|
||
| ### I added a fixed height property to a component |
There was a problem hiding this comment.
i set the dimensions (width or height) of a component
There was a problem hiding this comment.
ajouter un exemple avec un screenshot
| shadowOpacity: 0.2, | ||
| shadowOffset: { height: 1, width: 1 }, | ||
| elevation: 3, | ||
| backgroundColor: 'white', // <-- backgroundColor is mandatory for android |
There was a problem hiding this comment.
ajouter un exemple avec screenshot
There was a problem hiding this comment.
premier step :
shadowColor: 'grey',
shadowRadius: 10,
shadowOpacity: 0.2,
shadowOffset: { height: 1, width: 1 },
==> ne sont que pour ios
- pour android :
c'est elevation + backgroundcolor sur au moins un des composants qui contient le composant en question+ margin qui fait le travail
| - Why: <TextInput /> does not render identically on android and iOS: | ||
|
|
||
| - With android you might need to specify the `underlineColorAndroid` prop (can be set to `"transparent"` for example) | ||
| - The vertical alignment of the input text is not the same. This can be solved by using a marginTop that depends on the platform: `marginTop: Platform.OS === 'ios ? ...'` |
There was a problem hiding this comment.
plutot mettre un padding: 0 sur le TextInput, sans distinction de plateforme
| - With android you might need to specify the `underlineColorAndroid` prop (can be set to `"transparent"` for example) | ||
| - The vertical alignment of the input text is not the same. This can be solved by using a marginTop that depends on the platform: `marginTop: Platform.OS === 'ios ? ...'` | ||
|
|
||
| ### I mistakenly added text direcly as a `<View />`'s child |
|
|
||
| ### I used a javascript function that is not implemented the same way in react-native's javascript interpreters for android and iOS | ||
|
|
||
| - Why: As of July 2018, react-native's javascript interpreter for android is a little bit late compared to iOS's. There are a few methods that just won't work with android: |
There was a problem hiding this comment.
There are a few methods that just won't work with android (non comprehensive list):
|
|
Et dans les dépendances :
|
0e49b06 to
e77e45b
Compare
No description provided.