Xamarin Forms - make voiceover/talkback to callout abbreviations letter by letter instead of words.

Raj 1 Reputation point
2021-11-10T12:18:36.857+00:00

In our app there is an abbreviation like "FAQ". The voiceover/talkback in both ios and android platforms pronounce it as a word instead of calling out letter by letter.

How to achieve this?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,378 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 35,746 Reputation points Microsoft Vendor
    2021-11-11T07:43:20.657+00:00

    Hello,

    Welcome to our Microsoft Q&A platform!

    In iOS, you could set AccessibilityAttributedLabel and add comma( , )or space to separate "FAQ". It will display "FAQ" and speak as " F Q A ". However, voiceover also applies to braille, the comma will be detected in braille reader. I use CustomRenderer and AccessibilityAttributedLabel, you could have a try.
    XAML

     <local:MyLabel Text="FAQ now" FontSize="Title" Padding="30,10,30,10"></local:MyLabel>  
    

    Renderer in iOS

    [assembly: ExportRenderer(typeof(MyLabel), typeof(MyLabelRender_iOS))]  
    namespace TestVoiceOverDemo.iOS  
    {  
        public class MyLabelRender_iOS: LabelRenderer  
        {  
            protected override void OnElementChanged(ElementChangedEventArgs<Label> e)  
            {  
                base.OnElementChanged(e);  
                if (Control != null)  
                {  
                    NSMutableAttributedString FAQAttributedString = new NSMutableAttributedString("F A Q ");  
                    Control.AccessibilityAttributedLabel = FAQAttributedString;      
                }  
            }  
        }  
    }  
    

    In Android, you could add a zero width character( "\u200B" ).

    For more information, you can refer to
    https://stackoverflow.com/questions/58063598/how-to-make-voiceover-to-spell-each-letter-in-a-word
    https://stackoverflow.com/questions/53547488/pronounce-abbreviations-or-initialisms-as-individual-characters-in-androids-talk
    https://stackoverflow.com/questions/21774899/voice-over-doesnt-read-phone-number-properly
    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.