React-Native中ScrollView child layout ([“alignitems”, “justifyContent”]) must be applied through the contentContainerStyle prop…
我是直接在ScrollView组件上直接添加style属性,然后编写样式,了解了下居然是scrollView 和 FlatList之类的组件是不支持这个属性的。
解决办法是:
添加 contentContainerStyle属性,这些样式会应用到一个内层的内容容器上,所有的子视图都会包裹在内容容器内。或者是将scrollView之类的组件外层再套一层,样式放外层。