Google Photos iOS应用如何自定义本地共享表(例如UIActivityViewController)? [英] How did the Google Photos iOS app customize the native share sheet (e.g. UIActivityViewController)?

查看:82
本文介绍了Google Photos iOS应用如何自定义本地共享表(例如UIActivityViewController)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您在iOS版Google相册中共享照片时,Google会在UIActivityViewController顶部显示其自定义视图.我知道可以通过在顶级UIWindow上绘制自己的视图来半完成此操作,但是Google也会以某种方式隐藏底部的取消"按钮并填补空白,以使UIActivityViewController更加全屏".他们是否以某种方式将UIActivityViewController的视图嵌入到自己的视图中?

When you share photos in Google Photos for iOS, Google shows their own custom view on top of the UIActivityViewController. I know this can be semi-accomplished by drawing your own view on a top-level UIWindow, but Google also somehow hides the bottom 'Cancel' button and fill in the gaps to make it the UIActivityViewController more "full screen". Are they somehow embedding the UIActivityViewController's view inside their own view?

Google相册共享表:

Google Photos share sheet:

标准股:

推荐答案

我一直在寻找答案,偶然发现了您的问题,因此在推特上发布了它.马修·比绍夫(Matthew Bischoff)向我指出了这一点,应该或多或少地说明它是如何完成的. https://github.com/Jasdev/JDSActivityVC

I was looking for the answer to this and stumbled upon your question so I tweeted about it. Matthew Bischoff pointed me to this which should more or less explain how it's done. https://github.com/Jasdev/JDSActivityVC

简短的答案是您将UIActivityViewController子类化,并弄乱了生成的视图.提示:您需要弄乱视图控制器的view属性的超级视图.

The short answer is that you subclass UIActivityViewController and mess with the resulting views. Hint: you'll need to mess with the superview of the view controller's view property.

这篇关于Google Photos iOS应用如何自定义本地共享表(例如UIActivityViewController)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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