SwiftUI - 半模态? [英] SwiftUI - Half modal?

查看:27
本文介绍了SwiftUI - 半模态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 SwiftUI 中重新创建一个类似于 iOS13 中的 Safari 的 Modal:

这是它的样子:

有谁知道这在 SwiftUI 中是否可行?我想显示一个小的半模态,可以选择拖动到全屏,就像共享表一样.

非常感谢任何建议!

解决方案

我编写了一个 Swift 包,其中包含一个允许您使用半模态表的自定义修饰符.

这是链接:

I'm trying to recreate a Modal just like Safari in iOS13 in SwiftUI:

Here's what it looks like:

Does anyone know if this is possible in SwiftUI? I want to show a small half modal, with the option to drag to fullscreen, just like the sharing sheet.

Any advice is much appreciated!

解决方案

I've written a Swift Package that includes a custom modifier that allows you to use the half modal sheet.

Here is the link: https://github.com/AndreaMiotto/PartialSheet

Feel free to use it or to contribute

这篇关于SwiftUI - 半模态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆