Xamarin如何解决可访问性内容标签问题?
当我将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="" 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如已经指出的那样,您无法将
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 theImageButton
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 thecontentDescription
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.