I have a TextInput in React native. If i change the value using keyboard it works fine but, if i change it programmatically using a useState var then, if the text is too long, the text alignment becomes centered and i saw the text cut off on both sides.
我只想删掉结尾处的文字.
它在iOS上运行得很好,但在Android上就不行了.
谢谢你的帮助!
我试着用风格来做到这一点,但没有运气.文本对齐在第一次加载时是正确的,但如果我以编程方式更改它,则不是正确的. 预期的行为是看到文本仅在结尾处被切断.
下面是我的TextInput代码.没什么可看的:)
<TextInput
ref={ref}
editable={!props.disabled}
placeholder={isFocus || props.value ? undefined : props.title}
placeholderTextColor={colors.neutral[600]}
maxLength={props.maxLength || 60}
onFocus={setFocusOn}
onBlur={setFocusOff}
multiline={false}
value={checkedItems.length > 0 ? boxInfo : null}
/>