本文共 370 字,大约阅读时间需要 1 分钟。
今天发现View内的文字一行过去直接被屏幕右边吃掉,没有预期的换行,设置width也不管用,最后用它解决了
1. white-space:pre-line(不会保留空白和tabs)
2. white-space:pre-wrap(会保留空白和tabs)
.roomDesc { width: 710rpx; height: 184rpx; background: rgba(240, 239, 239, 1); border-radius: 10rpx; margin: 0 auto; font-size: 28rpx; font-family: MicrosoftYaHei; font-weight: 400; color: rgba(26, 26, 26, 1); white-space: pre-line;}
转载地址:http://qiod.baihongyu.com/