RN自定义样式无效
stechrayo opened this issue · 4 comments
stechrayo commented
-
antd-mobile 版本:~2.0.0-alpha.4
-
浏览器 (或标明是 react-native) 及其版本:react-native 0.41.2
-
操作系统及其版本:iOS 11.2.1
在真机上运行Demo:https://github.com/ant-design/antd-mobile-samples/tree/master/rn-custom-ui ,发现自定义的样式并没有生效。
我自己的代码按照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>
stechrayo commented
stechrayo commented
不好意思,我重新运行https://github.com/ant-design/antd-mobile-samples/tree/master/rn-custom-ui 又能正常显示自定义样式了。但是我自己项目在expo里还是不能显示定制样式
stechrayo commented
我把自定义的input放在我的工程里能正常显示自定义样式,那现在问题是,如何自定义List.Item的样式?
stechrayo commented
<Item style={styList.customItem}