ScalaJs:如何使用contentContainerStyle定义ScrollView

时间:2017-05-02 05:43:22

标签: scala react-native scala.js scalajs-react

在ScalaJs中,我想使用justifyContent和alignItems样式属性,但是当我通过普通样式执行它时,它会说:

必须通过contentContainerStyle prop应用ScrollView子布局([“alignItems”,“justifyContent”])。

def render() = {

    ScrollView(style = UniversalStyleSheet.style(attribute = "value"))(
        .
        .
        .
    )
  }

请尽可能分享一些代码

1 个答案:

答案 0 :(得分:0)

您只需将contentContainerStyle={styles.contentContainer}传递给ScrollView

即可

https://facebook.github.io/react-native/docs/scrollview.html#contentcontainerstyle