gpt4 book ai didi

ios - UISearchBar iOS 13 语音听写按钮

转载 作者:行者123 更新时间:2023-12-01 15:28:41 24 4
gpt4 key购买 nike

iOS 13 在所有系统应用程序的 UISearchBar 中都有语音听写按钮,它复制系统键盘上的麦克风按钮并显示听写 View :
enter image description here
但是当我在 Xcode 中创建新项目、添加 UISearchBar 并在设备上运行应用程序时,UISearchBar 上没有麦克风按钮。
有没有办法让我的应用程序在 UISearchBar 上显示那个麦克风按钮?

最佳答案

UISearchBar 中有一个 UISearchTextField 实例。您可以将 textField.rightView 设置为麦克风 View 。在麦克风按钮处理程序中,您执行语音到文本的识别。

关于ios - UISearchBar iOS 13 语音听写按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58893153/

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