合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
旋转手机,预览画面中物品高度变化明显,画面畸变。代码中的预览分辨率:previewProfile {"format":1003,"size":{"width":3200,"height":2400}},XComponent的surfaceWidth: 3200, surfaceHeight: 2400。
- XComponent({
- id: 'componentId',
- type: 'surface',
- controller: this.mXComponentController,
- }).onLoad(async () => {
- this.surfaceId = this.mXComponentController.getXComponentSurfaceId();
- let baseContext = this.getUIContext().getHostContext()! as common.BaseContext;
- await this.initCamera(baseContext, this.surfaceId)
- }).width('100%')
- .height('100%')
XComponent宽高比设置不当。
请确保.width('100%').height('100%')的值不都设置为100%,并保持width和height的比例与previewProfile的height与width比例一致。
合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
解决方案
精准高效的一站式服务支持,助力开发者商业成功