【问题标题】:Eclipse complaining about android layout xml fileEclipse 抱怨 android 布局 xml 文件
【发布时间】:2014-07-10 03:48:11
【问题描述】:

所以我是 android 新手,正在学习此处的教程http://www.vogella.com/tutorials/Android/article.html#firstandroidapp,并且正在要求我将背景颜色更改为银色的部分。当我插入android:silver="#C0C0C0" 时,它给了我如下所示的错误,即使我删除了该行,它仍然给我同样的错误。

error: No resource identifier found for attribute 'backGround' in package 'android'

这是我的 activity_main.xml 文件。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.harish.firstapp.MainActivity" >

    <EditText
        android:id="@+id/main_input"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="62dp"
        android:ems="10" >

        <requestFocus />
    </EditText>

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/main_input"
        android:layout_below="@+id/main_input"
        android:layout_marginLeft="67dp"
        android:layout_marginTop="59dp"
        android:text="Start"
        android:onClick="onClick" />

</RelativeLayout>

附:我已经尝试重新启动 Eclipse,但它仍然一直在抱怨。

【问题讨论】:

  • 如果任何答案对您有帮助,那么您应该接受它。

标签: java android xml eclipse


【解决方案1】:

这是

android:background

不是“背景”。 也许它可以提供帮助。

【讨论】:

    【解决方案2】:

    尝试改变

    android:silver="#C0C0C0"
    

    android:background="#C0C0C0"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-02-03
      • 1970-01-01
      • 2011-11-12
      • 2015-01-01
      • 2011-11-09
      • 1970-01-01
      • 1970-01-01
      • 2022-12-28
      相关资源
      最近更新 更多