小程序开发文本空格的添加

小程序开发 的时候,发现在文本内容中加入text-align: justify;后发现文本内容并未两端对齐,而加入 时也并未显示出来。
查阅官方api后发现如果需要加入空格就需要进行如下设置
<view> 
    <text space="ensp">你好 啊 哈哈哈(空格是中文字符一半大小)</text> 
</view> 
<view> 
    <text space="emsp">你好 啊 哈哈哈(空格是中文字符大小)</text>
</view> 
<view> 
    <text space="nbsp">你好 啊 哈哈哈(空格根据字体设置)</text>
</view>
 
<view>
    <text decode="{{true}}">账 户啊   (空格是中文字符一半大小)</text>
</view>
<view>
    <text decode="{{true}}">姓 名啊   哈哈哈(空格是中文字符大小)</text>
</view>
<view>
    <text decode="{{true}}">密 码   哈哈哈(空格根据字体设置)</text>
</view>
 

猜你喜欢

转载自www.cnblogs.com/bgwhite/p/9448902.html