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

Xcode14编译的版本List的头部出现空白间距 #27

Open
guo-melon opened this issue Aug 30, 2022 · 1 comment
Open

Xcode14编译的版本List的头部出现空白间距 #27

guo-melon opened this issue Aug 30, 2022 · 1 comment

Comments

@guo-melon
Copy link

guo-melon commented Aug 30, 2022

你好,谢谢你开源这么优秀的swiftui项目!

我用xcode14 beta5编译出来的版本,在list的section header部分出现了细微的差异。
具体表现在,iOS15的section header一切正常,iOS16的section header却出现了空白间距。

下面截图都是用Xcode14编译的app通讯录界面的效果,你可以看到明显的差异。

iOS16版本的C, F, G, N...上面都会出现空白部分

iOS15 iOS16

通过查看项目代码,我发现有定义过下面内容

// 避免 iOS15 增加的列表顶部空白 UITableView.appearance().sectionHeaderTopPadding = 0

但是上述设置貌似对iOS16不生效。

可能是因为iOS16版本下swiftui的list组件已经不再使用tableview,而是使用了collectionview这个原因吗?

本人swiftui小白,望大神给予解答,多谢!

@wxxsw
Copy link
Owner

wxxsw commented Aug 30, 2022

你好,我认为你说的是有道理的。但 UICollectionView 似乎没有全局的方法去设置头部。

因为解决方法可能需要尝试,我需要等到 Xcode 14 正式版发布才能更新,所以会晚点修复。

如果你有解决方案,欢迎提 PR,另外谢谢你这个详细描述的 issue。

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

2 participants