相关疑难解决方法(0)

Android Lint contentDescription警告

我收到警告,因为"[可访问性]在图像上缺少contentDescription属性"for imageview.而使用android lint

那是什么意思?

android android-layout android-lint

126
推荐指数
7
解决办法
11万
查看次数

辅助功能缺少图像上的contentDescription属性如何删除此警告?

辅助功能]图像上缺少contentDescription属性

 <ImageView
            android:id="@+id/imageView1"
            android:layout_width="34dp"
            android:layout_height="61dp"
            android:layout_marginLeft="11dp"
            android:layout_marginRight="0dp"
            android:layout_marginTop="11dp"
            android:background="#ff3333"
            android:src="@drawable/arrows" />
Run Code Online (Sandbox Code Playgroud)

android

18
推荐指数
2
解决办法
4万
查看次数

图像视图显示警告为未知属性 android:contentDescription 在 AS 3.4.1 中

当我将 Android studio 从 3.3 更新到 3.4.1 时,我在 ImageView 标签中遇到了一些有趣的警告,例如:android:contentDescription attribute is unknown。我该如何解决这个警告?或者是新的Android Studio 3.4.1的bug?

android android-layout kotlin android-constraintlayout androidx

7
推荐指数
0
解决办法
3627
查看次数

如何消除android layout.xml中的警告:"缺少contentDescription"

<ImageView style="@style/LoaderPrevNext.Next" />
Run Code Online (Sandbox Code Playgroud)

使用样式

<style name="LoaderPrevNext">
    <item name="android:layout_width">40dp</item>
    <item name="android:layout_height">80dp</item>
    <item name="android:layout_weight">0</item>
    <item name="android:scaleType">fitXY</item>
</style>

<style name="LoaderPrevNext.Next">
    <item name="android:src">@drawable/next_page</item>
    <item name="android:contentDescription">@string/img_desc_next_page</item>
</style>
Run Code Online (Sandbox Code Playgroud)

[Accessibility] Missing contentDescription attribute on image警告让我很生气.

如果我将contentDescription从样式移动或复制到ImageView标签,它就会消失,但由于src是在样式中定义的,我很乐意将它们保持在一起.

猜猜这只是一个SDK bug,但有些可能会有一个解决方法......

澄清:有问题的ImageView确实有一个内容描述,在LoaderPrevNext.Next样式中定义.警告是错误的.我对如何设置内容描述或如何将其破解为空的想法不感兴趣.

eclipse android android-layout

5
推荐指数
2
解决办法
5664
查看次数