Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use different styles for android and ios on react-native?

I want to use different styles for ios and android, how can I do it? And maybe somebody know how to stylizing TextInput, I need only bottom border, but borderBottomWidth doesnt work.

like image 921
lymmight Avatar asked Nov 18 '15 06:11

lymmight


1 Answers

There are many ways to achieve this. The simplest one in your case would be to use Platform.OS:

var {Platform} = React;

var styles = StyleSheet.create({
    height: (Platform.OS === 'ios') ? 200 : 100
});
like image 55
Emilio Rodriguez Avatar answered Oct 31 '22 08:10

Emilio Rodriguez