【问题标题】:Styling react-native-elements CheckBox Icon样式化 react-native-elements CheckBox 图标
【发布时间】:2019-11-20 05:58:53
【问题描述】:

我正在使用 react-native-elements 中的 CheckBox。在文档中,没有任何 IconProps。我使用了 IconRight 样式,但它仅从标题右侧对齐图标,但我想在视图末尾对齐图标。 这是代码 -

        <CheckBox
                title={item}
                key={index}
                value={item}
                ref={item}
                checked={checked}
                iconRight
                iconType="material"
                checkedIcon="clear"
                uncheckedIcon="add"
                checkedColor="red"
                onPress={() => {
                    this.controlcheck(item, checked);
                }}
            />

我想把+图标对齐到末尾的右边。

【问题讨论】:

  • 使用grid row col模块,或者使用flex layout flex direction flex-end
  • 感谢您的回复,但我说的是图标不是完整的复选框布局
  • 你试过用checkedIcon和uncheckedicon来提供一个带有flex-end的图标组件吗?
  • 请提供代码以及包装复选框的视图组件。

标签: react-native react-native-android react-native-elements


【解决方案1】:

你可以用这个:

<CheckBox
            title={<Text style={{flex:1}}>Hello World</Text>}
            
        />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-01
    • 2018-12-02
    • 1970-01-01
    • 2018-03-20
    • 1970-01-01
    相关资源
    最近更新 更多