Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

同样的模板鸿蒙平台的渲染效果和Android/iOS差距过大 #492

Open
yumi0629 opened this issue Oct 10, 2024 · 0 comments
Open

Comments

@yumi0629
Copy link

Describe the bug

同样的模板鸿蒙平台的渲染效果和Android/iOS差距过大,鸿蒙平台的组件尺寸、位置都正常。

Screenshots

Android效果:

WX20241010-145712@2x

鸿蒙效果:组件被裁剪(如便民服务只展示了上半部分)、车主生活中子组件上下位置不对、部分子组件(如标题)不展示

WX20241010-145900@2x

Phone (please complete the following information) :

  • Device: Mate 60 pro
  • OS:NEXT Developer Beta1
  • GaiaX SDK Version:本地打的har
  • GaiaX Template File and Template data:请见附件

便民服务.zip
车主生活.zip

鸿蒙侧代码:

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant