【问题标题】:How to make multiline TextInput textAlign to justify right? React Native如何使多行 TextInput textAlign 证明正确?反应原生
【发布时间】:2017-11-12 10:40:08
【问题描述】:

我需要在 TextInput 中显示多行文本,但我需要从右侧对齐它们。 我使用textAlign: 'justify',作为组件的样式,但它没有从右对齐。

<TextInput multiline={true} 
                  underlineColorAndroid='transparent'
                  editable={this.props.editable} 
                  style={[{backgroundColor: 'transparent',
                            left: 10,
                            right: 10,
                            textAlign: 'justify',
                            textAlignVertical: 'top',
                            fontFamily: 'B Yekan',
                            fontSize: 12,
                            lineHeight: 17,
                            }, this.props.style]} >
    //My text is showing here
</TextInput>

【问题讨论】:

    标签: javascript android ios react-native


    【解决方案1】:

    你试过gravity="end"吗,我刚试了一下,好像解决了你的问题。

    【讨论】:

    • 我刚试过,不行。我的文本是从右到左的,你的解决方案没有任何改变
    • 你试过gravity="start",或者“right”或者“left”吗? layout_gravity 也可以工作
    猜你喜欢
    • 2019-10-14
    • 1970-01-01
    • 1970-01-01
    • 2017-02-06
    • 2021-08-20
    • 1970-01-01
    • 2015-12-31
    • 1970-01-01
    • 2020-08-10
    相关资源
    最近更新 更多