NativeBase表示将所有组件包装在<Container></Container>
标记内。
<View></View>
标签?<Container>
标签替换所有<View>
标签,反之亦然?<Container>
并使用<View>
该组件内部的其余容器?问题中的第三点是正确的。 Container
组件每个屏幕仅应使用一次来包装所有子组件,有点像React.Fragment
。
[Container
通常采用三个子组件
<Container>
<Header> //<-always on top
...
</Header>
<Content> //<-supports scrolling
...
</Content>
<Footer> //<-always in the bottom
...
</Footer>
</Container>
使用全部时,功能或布局是否存在差异标签替换所有标签,反之亦然?
[[不建议将所有View
替换为Container
,因为Container
具有默认样式,并且其行为与使用View
组件包装组件的行为不同。