cover-view当中的css动画无效果
发布于 6 年前 作者 hfeng 16041 次浏览 来自 问答

根据API提示,cover-view 应该具备transform 和 opacity动画属性,但实际当中无法实现。

我设置了一个简单的view, 实现点击动画效果,原本应该同样适用于cover-view(在开发工具当中可以正常显示动画),但在真机测试当中点击后无任何效果

*.wxss

.button-one
{
 width: 200px;
   text-align: center;
   font-size: 16px;
   margin: 0 0 0 50px;
   outline: none;
   border-radius: 5px;
 color: white;
   background-color: #27ae60;
   padding: 10px 20px;
 user-select: none;
}
.button-one:active
{
   transform: translateY(5px);
 opacity: 0.8;
}

*.wxml

<cover-view class="button-one">Tap Mecover-view>

将cover-view替换成view可正常显示效果

回到顶部