-
Notifications
You must be signed in to change notification settings - Fork 29
Add standard: what differences between iOS and android should I be aware of #146
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i set the dimensions (width or height) of a component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
et des margin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ajouter un exemple avec screenshot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
directly
|
||
### 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.