-
Notifications
You must be signed in to change notification settings - Fork 149
Open
Description
Describe the bug
同样的模板鸿蒙平台的渲染效果和Android/iOS差距过大,鸿蒙平台的组件尺寸、位置都正常。
Screenshots
Android效果:
鸿蒙效果:组件被裁剪(如便民服务只展示了上半部分)、车主生活中子组件上下位置不对、部分子组件(如标题)不展示
Phone (please complete the following information) :
- Device: Mate 60 pro
- OS:NEXT Developer Beta1
- GaiaX SDK Version:本地打的har
- GaiaX Template File and Template data:请见附件
鸿蒙侧代码:
List() {
ListItem() {
GXComponent({
templateItem: this.templateCarOwnerLife,
templateData: this.templateDataCarOwnerLife,
measureSize: this.measureSize
})
}
ListItem() {
GXComponent({
templateItem: this.templateConvServices,
templateData: this.templateDataConvServices,
measureSize: this.measureSize
})
}.margin({ top: 15 })
}
.width('100%')
.height(360)
尺寸计算相关代码
let sWidth = GXContext.shared().screenWidth;
let sScale = GXContext.shared().screenScale;
const scale = sScale ?? 1;
// size
this.measureSize = new Size(sWidth / scale - 30, NaN);
Metadata
Metadata
Assignees
Labels
No labels