小程序开发 的时候,发现在文本内容中加入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>
 

相关文章:

  • 2021-10-31
  • 2021-12-27
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-04-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-17
  • 2022-12-23
  • 2021-11-03
  • 2022-02-08
  • 2021-11-19
  • 2022-02-08
相关资源
相似解决方案