style Vs contentContainerStyle in ScrollView?

前端 未结 1 1746
长发绾君心
长发绾君心 2020-12-30 23:11

When I apply {alignItems: \'center\', justifyContent: \'center\'} to style prop, got following error,

ScrollView child layo

相关标签:
1条回答
  • 2020-12-30 23:42

    You're correct, think of it like this, ScrollView is a special kind of View, ScrollView has two parts:

    1. Container (the grey box), it's the outside View, its height can't exceed 100% of the window height

    2. Content (marked in blue) is the inner part, it can be higher than the window height, it's what's moving inside the container.

    ScrollView style defines the outer container of the ScrollView, e.g its height and relations to siblings elements

    ScrollView contentContainerStyle defines the inner container of it, e.g items alignments, padding, etc

    0 讨论(0)
提交回复
热议问题