gpt4 book ai didi

ios - UNNotificationContentExtension 可以处理滑动吗?

转载 作者:行者123 更新时间:2023-11-28 15:55:41 25 4
gpt4 key购买 nike

我一直在使用 UNNotificationContentExtension,我已经创建了一个包含 ScrollView 的自定义 UI。我用 ImageView 加载 ScrollView ,它是一个图像轮播,图像轮播应该水平移动。

我的 ScrollView 设置正确,但 ScrollView 不水平滚动。

我通过以编程方式滚动来检查我的图像是否在轮播中

scrollView.setContentOffset(CGPoint(x: x, y: y), animated: true)

另外,我的每张图片都应该在我的应用程序中打开不同的页面。所以我所做的是将点击手势添加到各个 imageViews。

所以我的问题是,

UNNotificationContentExtension 是否可以在水平方向上平移 scrollView?

是否可以根据点击的图片在应用中打开不同的页面?

最佳答案

So my questions are,

Is it possible for UNNotificationContentExtension to translate a scrollView in horizontal direction?

Is it possible to open different pages in app based on the images clicked?

没有也没有。 UNNotificationContentExtension 不以任何方式与用户交互,除了运行时根据请求为您插入的播放按钮等元素。

编辑:请注意,这在 iOS 11 及之前的版本中是正确的,但在 iOS 12 中发生了变化,在 Info.plist 的 NSExtensionAttributes 中成为可能,添加 UNNotificationExtensionUserInteractionEnabled bool 键并将其值设置为 YES。现在,整个用户交互机制都栩栩如生了。

关于ios - UNNotificationContentExtension 可以处理滑动吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41778496/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com