【发布时间】:2021-09-11 15:43:28
【问题描述】:
我正在使用带有样式组件的 react-native
如果你在文本中键入一个字符串并按空格键,它将换行或创建一个两个多的空格。
喜欢这张图片
我只在图片中使用过一两次空格。但是换行是这样的:
这是我的代码
const Container = styled.View`
flex-direction: column;
margin: 1% 2% 0 2.5%;
border-bottom-width: 0.8px;
border-color: #c6cfc7;
`;
const CommentContainer = styled.View`
padding: 4.5% 2% 3.5% 5%;
margin-top: 0.5%;
`;
const SecondCommentCon = styled.View`
`;
const LabelContainer = styled.View`
background: lightblue;
width: 100%;
`;
const Label = styled.Text`
background: lightcoral;
padding-top: 3.5%;
line-height: 18px;
top: 0.5%;
font-size: 13px;
`;
return (
<>
<Container>
<CommentContainer>
<SecondCommentCon>
<LabelContainer>
<Label>{item.content}</Label>
</LabelContainer>
</SecondCommentCon>
</CommentContainer>
</Container>
</>
);
};
export default TodoItem;
如何修改我的代码来解决这个问题?
【问题讨论】:
标签: javascript css node.js reactjs react-native