transform ios和安卓位置不一
发布于 5 年前 作者 ping73 13626 次浏览 来自 问答

很简单的布局,如下

但是在安卓上确实这样的表现.- -

明显不居中

代码如下:

外部淡蓝圆圈

.int_tShow {

  position: relative;
  top: 0;
  left: 0;
  width: 48rpx;
  height: 48rpx;
  border-radius: 50%;
  background: #9cbcff

}



内部深蓝圆圈

.int_ttShow {

position: absolute;

top:50%;

left: 50%;

transform: translate(-50%, -50%);

width: 32rpx;

height: 32rpx;

border-radius: 50%;

background: #5084ef;

}



不同安卓机型偏差不同! 请赐教

回到顶部