如何在 React Native 中做最后一个子选择器?

Gün*_*ıcı 2 css reactjs react-native

我使用 Scrollview,其中有 3 个视图。我在他们之间留了一个空隙。

例如:“marginRight:5”。

但我不希望在最后一个视图中出现这种差距。这就是为什么我需要这种东西。你能帮助我吗?

cod*_*uix 5

应用这个你可以达到你想要的

const styles = EStyleSheet.create({
  p: {
    marginRight: 5
  },
  'p:last-child': {
    marginRight: 0
  }
});
Run Code Online (Sandbox Code Playgroud)

编辑:使用组件 https://github.com/vitalets/react-native-extended-stylesheet