xamarin - iOS 的accessibilitySpeechIPANotation 的值(value)是什么

标签 xamarin xamarin.ios accessibility avspeechsynthesizer

基于此 WWDC2018 video ,我们可以动态改变单词在 AVSpeechSynthesizer 中的发音方式.
enter image description here

我正在尝试在我的 Xamarin 应用程序中执行此操作,但找不到 accessibilitySpeechIPANotation持续的。

NSMutableAttributedString.AddAttribute(...) 的文档中它说可以在这里找到常量:UIKit.UIStringAttributeKey .然而我要找的那个不在那里。

有谁知道常量的实际字符串值是多少?或者甚至更好,我可以在 Xamarin.iOS 中找到?

(我的应用程序使用 xamarin.ios v4.0.30319,如果常量在框架的较新版本中,我会更新它,但是当我搜索它时,google 似乎没有给我任何结果。)

最佳答案

原因:
Xamarin for iOS 是基于 Objective-C 的,swift 和 Objective-C 有一些区别。

解决方案:
代码如下:

var attriStrng = new NSMutableAttributedString(new NSString("hello iPhone"));
// you can set the voice here ,a͡͡a͡͡a͡͡a͡͡a͡͡ is just for testing
attriStrng.AddAttribute(new NSString("AVSpeechSynthesisIPANotationAttribute"), new NSString("ˈa͡͡a͡͡a͡͡a͡͡a͡͡a͡͡a͡͡.ˈfo͡ʊn"),new NSRange(6,6));

var voice = new AVSpeechUtterance(attriStrng);

AVSpeechSynthesizer synthesizer = new AVSpeechSynthesizer();
synthesizer.SpeakUtterance(voice);

关于xamarin - iOS 的accessibilitySpeechIPANotation 的值(value)是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54412952/

相关文章:

android - 我的 Xamarin Android 应用程序突然收到 "Error: TrustFailure (The authentication or decryption has failed.)"

c# - Monotouch - CMSampleBufferGetSampleTimingInfoArray

xamarin.ios - 单触式许可证

iOS 辅助功能 - 语音再次循环重复相同的 UI 元素

javascript - NVDA 屏幕阅读器无法与大型菜单键盘导航一起使用

c# - instanceof 检查动态类型

xamarin - 更新 Nuget 导致异常未处理 : System. TypeLoadException

android - 关闭 MVVMCross 中的 DialogFragment

ios - 如何,Xamarin iOS 中的 applicationDidBecomeActive?

html - 具有 alt 属性但没有文本的 img 是否满足 WCAG 2.0 : Technique H30?