<swiper class="{{swiperClass}}" current="{{activeTab}}" duration="{{duration}}" bindchange="handleSwiperChange"> <swiper-item wx:for="{{tabs}}" wx:key="title"> <scroll-view style="height:100%" scroll-y="true" bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll"> <slot name="tab-content-{{index}}"></slot> </scroll-view> </swiper-item> </swiper>
swiper-item里面的scroll-view无效,设置高度之后,swiper又无法左右移动了我想做一个左右能够轮播专栏,上下能够滑动查阅信息文章的一个页面,但是使用swiper + scroll-view的时候突然就搞出一个这么大的问题。。。 <swiper style="height:100%;"> <swiper-item style="height:100%"> <scroll-view style="height:100%" scroll-y="true"> </scroll-view> </swiper-item> <swiper-item style="height:100%;" > <include src=""/> </swiper-item> </swiper> //wxml文件,这个时候不能上下滑动 <swiper style="height:{{number*450}}rpx"> <-- 引入一个变量,number是文章数量,然后动态更新液面高度 --> <swiper-item style="height:100%"> <scroll-view style="height:100%" scroll-y="true"> </scroll-view> </swiper-item> <swiper-item style="height:100%;" > <include src=""/> </swiper-item> </swiper> z这个时候就可以上下滑动,但是swiper就没办法左右移动了,求助啊
2022-01-14[图片] 开发者工具可显示“步数:0” [图片] 2.安卓客户端不显示
canvasContext.fillText在安卓客户端不显示- -当前 Bug 的表现(可附上截图) ctx.fillText的文字,在开发工具上可见,在iOS客户端可见,在安卓客户端不可见 1. 2. -预期表现 在安卓客户端可见 -复现路径 -提供一个最简复现 Demo import * as THREE from './libs/three.min.js' let ctx = canvas.getContext('webgl') let cameraOrtho, sceneOrtho let width,height let stepText let texture3 let stepCanvas = wx.createCanvas('canvas') let stepContext = stepCanvas.getContext('2d') let stepNum=0 init(); animate(); function init(){ width = window.innerWidth; height = window.innerHeight; sceneOrtho = new THREE.Scene(); cameraOrtho = new THREE.OrthographicCamera(- width/ 2, width / 2, height / 2, - height/ 2, 1, 10); cameraOrtho.position.z = 10; StepText() ; renderer = new THREE.WebGLRenderer({ antialias: true, context: ctx }); renderer.setClearColor(0x454545); renderer.setSize(window.innerWidth, window.innerHeight); renderer.autoClear = false; document.body.appendChild(renderer.domElement); } function StepText() { stepCanvas.width =128; stepCanvas.height = 64; stepContext.font = "20px Arial"; stepContext.fillStyle = '#00ff00'; stepContext.clearRect(0, 0, stepCanvas.width, stepCanvas.height); stepContext.fillText("步数:" + stepNum, 0, 48, stepCanvas.width, stepCanvas.height); texture3 = new THREE.CanvasTexture(stepCanvas); let material3 = new THREE.SpriteMaterial({ transparent: true, opacity: 1 }); material3.map = texture3; let width3 = stepCanvas.width; let height3 = stepCanvas.height ; stepText = new THREE.Sprite( material3 ); stepText.scale.set( width3, height3, 1); stepText.visible = false; stepText.position.set( -width / 2 + 80, height / 2 - 72, 1); sceneOrtho.add(stepText ); } function animate() { requestAnimationFrame(animate); texture3.needsUpdate = true; render(); } function render(){ renderer.clear(); renderer.render(sceneOrtho, cameraOrtho); }
2019-01-31学习过程中,遇到了类似的问题。Three.js搭建了3D场景,添加了2d的canvas作为Plane的纹理。开发工具可正常显示fillRect的内容,正常显示fillText的内容,正常显示图片。真机Android可显示fillRect,无法显示fill Text的内容和图片纹理,ios可显示fillRect/fillText,无法显示图片。
Android平台2D,3D混合渲染不能正常显示尝试将界面HUD绘制到单独的Canvas(实际代码用PIXI.js创建Canvas), 然后将该Canvas作为纹理绘制到THREE.js 3D的Mesh中, 模拟器和iOS能正常显示纹理,Android显示为黑色,如果将getContext('webgl')改为getContext('2d')然后fillRect, 几种平台都能正常显示。 猜测,在Android下只能获取一个webgl Canvas var canvas = wx.createCanvas(); ... var gl = this.canvas.getContext('webgl', {}); gl.clearColor(1.0, 0.0, 0.0, 1.0); gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT); ... var texture = new THREE.CanvasTexture(canvas); texture.minFilter = THREE.LinearFilter; var material = new THREE.MeshBasicMaterial({ map: texture, transparent: true }); var geometry = new THREE.PlaneGeometry(canvas.width / window.devicePixelRatio / PIXELS_PER_UNIT, canvas.height / window.devicePixelRatio / PIXELS_PER_UNIT); var sprite3D = new THREE.Mesh(geometry, material); ... scene3D.add(sprite3D); 测试问题机: 小米8,小米MIX
2019-01-18