Xamarin如何解决可访问性内容标签问题?

发布于 2025-02-06 14:38:14 字数 1356 浏览 2 评论 0原文

当我将Relese上传到Google Play控制台时,在内部测试后,Y具有与此组件关联的警告(可访问性=>内容标签)。

< imageButton .../>

在这里建议使用 android:contentDescription

,然后我添加 xmlns:android =“ http://schemas.android.com/apk/apk/res/android” and:

< imageButton android:contentDescription =“ bla bla” .../>

但我遇到了一个错误:属性contentDescription在类型Image button中找不到。

i尝试使用 xct:smanticeffect.description ,但我没有编译器错误,但是在Google Play控制台中,我仍然会看到警告。

更多信息:

完整组件代码:

<ImageButton BackgroundColor="Transparent" Margin="5" xct:SemanticEffect.Description="abrir menú" Clicked="OnBackButtonClicked" >
    <ImageButton.Source>
        <FontImageSource FontFamily="FAL" Glyph="&#xf057;" Color="{StaticResource Gray3}" Size="25"/>
    </ImageButton.Source>
</ImageButton>

Google Play Console -google play Console-预先发布的报告详细信息 - Acpesibility Tab

内容标记此组件的警告

When i upload a relese to Google Play Console, after internal testing y have a warning (Accessibility => Content labeling) associated to this component.

<ImageButton .../>

Here the recomendation is use android:contentDescription

Then i add xmlns:android="http://schemas.android.com/apk/res/android"
and:

<ImageButton android:contentDescription="bla bla" .../>

But i get an error: The property contentDescription was not found in type ImageButton.

I try to use xct:SemanticEffect.Description and i have not compiler error but in Google Play Console i still see the warning.

More Information:

Full component code:

<ImageButton BackgroundColor="Transparent" Margin="5" xct:SemanticEffect.Description="abrir menú" Clicked="OnBackButtonClicked" >
    <ImageButton.Source>
        <FontImageSource FontFamily="FAL" Glyph="" Color="{StaticResource Gray3}" Size="25"/>
    </ImageButton.Source>
</ImageButton>

Google Play Console - Pre-launch report details - Accesibility tab

Content labeling warning for this component

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蛮可爱 2025-02-13 14:38:14

如已经指出的那样,您无法将android:contentDescription =“ bla bla”直接添加到image> imagebutton一个来自Android平台,后者在Xamarin.forms级别上。 。

如果使用Xamarin社区工具包,并应用SemantIceffect.description =“ Bla Bla”,该应该转换为Android上的ContentDescription。如果不是这种情况,我很想知道您在应用之后得到的确切警告是什么。

As already pointed out, you cannot add android:contentDescription="bla bla" directly to the ImageButton one is from the Android platform, the latter is on the Xamarin.Forms level.

If you use the Xamarin Community Toolkit and apply the SemanticEffect.Description="bla bla" that should translate into the contentDescription on Android. If that is not the case, I would be curious to know what the exact warning is that you get after applying it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文