ant-design/antd-mobile-samples

RN自定义样式无效

stechrayo opened this issue · 4 comments

我自己的代码按照Readme也未生效:

  • antd-mobile 版本:~2.1.3
  • 浏览器 (或标明是 react-native) 及其版本:react-native 0.50.3
  • 操作系统及其版本:iOS 11.2.1
import listDefaultStyle from 'antd-mobile/lib/list/style/index.native';

const newListStyle = {
  ...listDefaultStyle,
  Item: {
    ...listDefaultStyle.Item,
    paddingLeft: 0,
    backgroundColor: 'red',
  },
}

<List styles={StyleSheet.create(newListStyle)}>
// ...
</List>

不好意思,我重新运行https://github.com/ant-design/antd-mobile-samples/tree/master/rn-custom-ui 又能正常显示自定义样式了。但是我自己项目在expo里还是不能显示定制样式

我把自定义的input放在我的工程里能正常显示自定义样式,那现在问题是,如何自定义List.Item的样式?

<Item style={styList.customItem}