V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Livid
V2EX  ›  Swift

SwiftUI 里的 VStack / HStack 的 spacing 是否有来自 Apple 官方的标准?

  •  
  •   Livid · 2022-10-18 21:59:55 +08:00 · 1368 次点击
    这是一个创建于 526 天前的主题,其中的信息可能已经有所发展或是发生改变。

    比如各种元素之间的间距:表单和按钮之间的间距等等。

    Apple 是否有发布过这方面的标准?

    3 条回复    2023-04-22 02:12:37 +08:00
    Rhianu
        1
    Rhianu  
       2023-02-01 09:41:07 +08:00
    在文档上没有体现,但我发现在 tvOS 、iOS 、macOS 上开发 App 的测试看,各平台间距表现不同。顺便吐槽一下,这个 SwiftUI 问题太多了,用它开发商业项目走一步一个坑。
    galenjiang
        2
    galenjiang  
       2023-02-21 09:02:09 +08:00
    chipmuck
        3
    chipmuck  
       341 天前
    在 WWDC19 的 Building Custom Views with SwiftUI session 中的 Layout 讲解部分有提到:

    “You'll also find that the baseline to baseline spacing for adjacent text exactly matches Apple's human interface guidelines, as does the baseline to edge spacing.”

    但是没有讲到具体数值。

    https://developer.apple.com/videos/play/wwdc2019/237/

    时刻在 12:12 左右
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3229 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 11:40 · PVG 19:40 · LAX 04:40 · JFK 07:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.