backface-visibility 属性在存在内嵌元素时显示错误

小游戏 企业微信 微信支付 小程序 文章 2020-07-30 21:20 813 0 全屏看文

AI助手支持GPT4.0

backface-visibility 属性在存在内嵌元素时显示错误
框架类型 问题类型 终端类型 微信版本 基础库版本
小程序 Bug 微信安卓客户端 7.0.17 2.9.0

卡牌正反面的需求。等效代码在 chrome 是没有问题的,但在小程序开发工具和安卓上有问题。(iOS 没测)

具体问题:如果卡牌正反面只是图片,正反显示都没问题。如果卡牌正反面是容器,里面有图片和文字。卡牌翻转过来,正反面的文字都显示了。预期只显示某一面的文字。

// wxml<view class="card-wrapper {{ status ? 'show-cover' : '' }}">  <view class="cover-image">    <image class="card-image" src="{{ coverImage }}" />    <text class="card-text">{{ text }}</text>  </view>  <view class="back-image">    <image class="card-image" src="{{ backImage }}"></image>    <text class="card-text">{{ text }}</text>  </view></view>// wxss.card-wrapper {  width100%;  height100%;  position: relative;  transform-style: preserve-3d;}.card-wrapper.show-cover {  transform: rotateY(180deg);}.cover-image,.back-image {  width100%;  height100%;  position: absolute;  left0;  top0;  backface-visibility: hidden;}.cover-image {  transform: rotateY(180deg);  transform-origin: center;}/* .back-image {  backface-visibility: hidden;} */.card-image {  width100%;  height100%;}.card-text {  display: block;  width100%;  line-height1;  margin-top: -120rpx;  text-align: center;  color: white;  font-size36rpx;  text-shadow:1px 2px 4px rgba(27,95,168,0.6);}.back-image .card-text {  opacity0.4;  margin-top: -128rpx;}


Framework type problem type terminal type wechat version basic library version applet bug wechat Android client 7.0.17 2.9.0 card front and back requirements. The equivalent code has no problem in chrome, but it has problems in applet development tools and Android. (IOS not tested) specific problem: if the front and back of the card are just pictures, the front and back display is OK. If the front and back of the card are containers, there are pictures and text inside. The card is turned over and the words on the front and back are displayed. Only one side of the text is expected to be displayed. / / wxml          {{ text }}            {{ text }}  // wxss.card -wrapper {  width: 100%;  height: 100%;  position: relative;  transform-style: preserve-3d;}.card- wrapper.show -cover {  transform: rotateY(180deg);}.cover-image,.back-image {  width: 100%;  height: 100%;  position: absolute;  left: 0;  top: 0;   backface-visibility: hidden;}.cover-image {  transform: rotateY(180deg);  transform-origin: center;}/* .back-image {  backface-visibility: hidden;} */.card-image {  width: 100%;  height: 100%;}.card-text {  display: block;  width: 100%;  line-height: 1;  margin-top: -120rpx;  text-align: center;   color: white;  font-size: 36rpx;  text- shadow:1px  2px 4px rgba(27,95,168,0.6);}.back-image .card-text {  opacity: 0.4;  margin-top: -128rpx;}

回答:

社区技术运营专员-CJiang:

麻烦提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
创建卡券有效期的结束日期按照文档填写当天的23:59:59,但是显示出来却增加了一天?
从来不把合作伙伴当伙伴对待,怪不得做不过别的平台
小程序涉嫌虚拟支付被封,可根本就没任何支付功能
为什么老是出现上传图片显示系统错误而无法上传啊?
关于painter 画出海报保存不了,不报错也没进入回调,有大佬么?
随便看看
微信开放平台跟公众平台有什么区别? 3607
怎么添加小程序支付功能? 4516
教育科技公司申请微信支付被拒绝? 4798
微信公众号免300认证教程 5892
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5299
小程序广告组件通过审核,但是小程序内没有显示广告? 5067
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9568
问题? 9047
如何快速搭建抽奖助手小程序(无需代码知识) 6177
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 7471