Margins on Page affects UI and breaks it on iOS

未关闭
#6,318 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
android, ios, typescript
领域
mobile-dev

调研方向

从链接的 NativeScript TypeScript playground 开始,使用报告的 4.2.0 版本,在 iOS 和 Android 上重现 Page 和 ScrollView 的 margin 行为。跟踪 Page 的 margin、padding 和 size 如何参与测量,然后验证这些属性不再影响布局,并且用户在设置这些属性时会收到警告。

由索引模型根据 Issue 内容生成。

描述

os: ios
Which platform(s) does your issue occur on?

iOS/Android/Both

Please provide the following version numbers that your issue occurs with:
  • CLI: 4.2.0
  • Cross-platform modules: 4.2.0
  • Runtime(s): 4.2.0
Please tell us how to recreate the issue in as much detail as possible.

Since {N} 4.0 setting margins, padding and size to a Page results in undefined/different behavior on both platforms. The reason is that on iOS we let the system lay out pages and these properties are ignored. However, they still take part in measure and affect the nested UI.

Proposed Solution: I think the correct behavior is to ignore these properties on the Page component and warn the user they will not take effect.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

Can be reproduced with this playground:
https://play.nativescript.org/?template=play-tsc&id=l4geyI&v=3

The code that is important is:

Page {
    margin: 100;
}

ScrollView {
    margin: 10;
}

On Android it looks correct-ish. On iOS the Page margin is applied on the ScrollView and the ScrollView margin is lost.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

主要语言
TypeScript
星标
25.7k
派生
1.7k
平均合并
1 天 5 小时
30 天内合并 PR
35

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NativeScript/NativeScript 的其他 Issue

查看 NativeScript/NativeScript 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。