我想为 ios 和 android 使用不同的样式,我该怎么做? 也许有人知道如何风格化 TextInput,我只需要底部边框,但 borderBottomWidth 不起作用。
最佳答案
有很多方法可以实现这一点。在您的情况下,最简单的方法是使用 Platform.OS:
var {Platform} = React;
var styles = StyleSheet.create({
height: (Platform.OS === 'ios') ? 200 : 100
});
关于javascript - 如何在 react-native 上为 android 和 ios 使用不同的样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33773207/