收藏
回答

小程序兼容三星S8机型问题

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug view 客户端 7.0.0 2.50

- 当前 Bug 的表现(可附上截图)


- 预期表现


- 复现路径

改样式在其他如华为、iPhone、小米机型正常显示,但是在三星S8机型无法垂直居中显示


- 提供一个最简复现 Demo

<view class='wrapper' style="width:80rpx;height:36rpx;border: 2rpx solid {{color}}">

   <view class='container' style="color:{{color}};">

       <view class='text' style="font-size:48rpx">{{text}}</view>

   </view>

</view>


回答关注问题邀请回答
收藏

1 个回答

  • yang.
    yang.
    2019-01-23

    .wrapper{

    position: relative;

    box-sizing: border-box;

    }

    .container{

    position: absolute;

    width: 200%;

    height: 200%;

    left: -50%;

    top: -50%;

    transform: scale(0.5, 0.5);

    transform-origin: 50% 50%;

    border-radius: 8rpx;

    display: flex;

    justify-content: center;

    align-items: center;

    overflow: hidden;

    }

    .text {

    line-height: 16rpx;

    width: 100%;

    text-indent: 10rpx;

    letter-spacing: 10rpx;

    text-align: center;

    }


    2019-01-23
    有用
    回复
登录 后发表内容