line-height 真机上失效
发布于 6 年前 作者 juan11 2402 次浏览 来自 问答

真机图:

小程序开发端:

IOS 安卓上都无法居住,很奇怪,昨天还是可以的

7 回复

麻烦提供下机型

text是行内元素,设置高度是无效的

请问是自定义标题栏吗?

开发者端

小程序端:

<view class=‘common-header’ style=‘padding-top: {{topHeight.top}}rpx;height:{{topHeight.height}}rpx;’>

<image src=’./back.png’ class=‘back’ style=‘top: {{ topHeight.top + (topHeight.height - 50) / 2 }}rpx;’ wx:if="{{currentLength != 1 && backPage}}" bindtap=‘goBack’></image>

<image src=’./home.png’ class=‘back’ wx:if="{{currentLength == 1 && backPage}}" bindtap=‘goHome’></image>

<text class=‘title’ style=‘background:#000;height:{{topHeight.height}}rpx; line-height:{{topHeight.height}}rpx;’>{{title}}</text>

</view>

<view style=‘height: {{ topHeight.top + topHeight.height }}rpx; background:red’></view>

同样的高度,手机端被减了,请看黑色块高度为 topHeight.height,红色块为 topHeight.top + topHeight.height

但是我设置了 display:block 了啊,其次 我使用了 flex 布局也不行,还有其他地方的文本文字设置了也是没问题的呢!

@黄思程  我这里的手机都会的

回到顶部