【问题标题】:react native: style props on TouchableOpacity componentreact native:TouchableOpacity 组件上的样式道具
【发布时间】:2018-12-16 10:40:44
【问题描述】:

在 react native docs(https://facebook.github.io/react-native/docs/touchableopacity) 中,没有关于 style props 的解释。但我已经知道在 TouchableOpacity 组件上使用样式道具是可以的。

例如

<TouchableOpacity style={styles.button}>
...
</TouchableOpacity>

这怎么可能?

【问题讨论】:

    标签: react-native


    【解决方案1】:

    我不明白,但 TouchableOpacity 可以设置道具“activeOpacity”以在单击按钮时更改不透明度。

    【讨论】:

    • 我添加更多解释你能给我任何帮助吗?
    • 您可以使用不透明度设置 TouchableOpacity 的样式: 它只接受不透明度,不接受字体大小,就像道具 activeOpacity。
    猜你喜欢
    • 2019-03-03
    • 1970-01-01
    • 2021-09-18
    • 1970-01-01
    • 2021-09-15
    • 2021-05-10
    • 2019-11-11
    • 2020-11-02
    • 2021-03-09
    相关资源
    最近更新 更多