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

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

问题描述

我正在尝试像Swift13中的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天全站免登陆