使用场景:在文字个数不一致时,实现两端对齐的效果,是页面看起来更美观一点。

两端对齐效果:
<template>
<view class="jianju">
<text class="orderTitle">昵称:</text>
<text class="orderTitleDetail">xxx</text>
</view>
<view class="jianju">
<text class="orderTitle">手机号码:</text>
<text class="orderTitleDetail">12345678541</text>
</view>
</template>
.orderTitle {
width: 220rpx;
height: 40rpx;
margin-right: 20rpx;
font-size: 28rpx;
color: #2f2f2f;
line-height: 40rpx;
display: inline-block;
// 主要是这个属性 两端对齐 最后一行无效
text-align: justify;
// 这是强制最后一行对齐
text-align-last: justify;
}
.orderTitleDetail {
width: 460rpx;
line-height: 40rpx;
font-size: 26rpx;
color: #909090;
}

3025

被折叠的 条评论
为什么被折叠?



