line-height 真机上失效

发布于 8 年前作者 juan112535 次浏览最后编辑 8 年前来自 ask

真机图:

WXOPEN Club 内容图片

小程序开发端:

WXOPEN Club 内容图片

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

7 回复
shenming
shenming1 楼6 年前

麻烦提供下机型

wren
wren2 楼6 年前

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

penggang
penggang3 楼6 年前

请问是自定义标题栏吗?

gzhou
gzhou4 楼6 年前

开发者端

WXOPEN Club 内容图片

小程序端:

WXOPEN Club 内容图片

<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>

tanqiang
tanqiang5 楼6 年前

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

yinfang
yinfang6 楼6 年前

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

xiulan72
xiulan727 楼6 年前

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