菜鸟教程小白 发表于 2022-12-11 20:08:08

ios - Swift IOS 中的可访问性画外音单次滑动手势


                                            <p><p>我正在开发与画外音相关的 IOS 应用程序,我的问题是:启用辅助功能画外音后,如何获得向左、向右、向上和向下滑动手势,快速检测这些手势的功能是什么?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>首先,您需要让 VoiceOver 知道您的 View (或其他元素)。因此,如果您在 ViewController 中,这应该可以工作:<code>self.view.isAccessibilityElement = true</code></p>

<p>其次,您需要让 VoiceOver 知道您的 View 将自行处理用户交互:<code>self.view.accessibilityTraits = UIAccessibilityTraitAllowsDirectInteraction</code>。之后,您的 View 应该开始收到手势通知。 </p>

<p>这是另一个相关的答案:<a href="https://stackoverflow.com/a/20712889/2219578" rel="noreferrer noopener nofollow">https://stackoverflow.com/a/20712889/2219578</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - Swift IOS 中的可访问性画外音单次滑动手势,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/50211570/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/50211570/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - Swift IOS 中的可访问性画外音单次滑动手势