【问题标题】:Error : Multiple annotations found at this line:错误:在此行找到多个注释:
【发布时间】:2012-05-17 14:25:19
【问题描述】:

在这一行找到多个注释: - [辅助功能] 缺少 contentDescription 属性 在图片上

我的 xml 代码是:

 <?xml version="1.0" encoding="utf-8"?>
  <ImageView xmlns:android="http://schemas.android.com/apk/res/android"
             android:id="@+id/iv_Seelct_Image"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:src="@drawable/select_image"/>
  <GridView  
          android:id="@+id/gridview"
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent"
          android:columnWidth="270dp"
          android:numColumns="auto_fit"
          android:verticalSpacing="10dp"
          android:horizontalSpacing="10dp"
          android:stretchMode="columnWidth"
          android:gravity="center"/>

【问题讨论】:

    标签: android xml


    【解决方案1】:

    您的 xml 文件必须具有像 LinearLayout 或 RelativeLayout 这样的根布局

    <RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent">
    
    <your imageview>
    <your gridview>
    
    
    </RelativeLayout>
    

    【讨论】:

      【解决方案2】:

      您需要将android:contentDescription="@string/desc" 作为属性添加到 ImageView。

      【讨论】:

      • 阅读更多相关信息herehere
      • 当此类警告出现时,用于“[Accessibility] Missing contentDescription attribute on image”
      猜你喜欢
      • 1970-01-01
      • 2015-12-06
      • 1970-01-01
      • 2017-12-16
      • 2015-10-02
      • 1970-01-01
      • 2016-03-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多