简体   繁体   English

Eclipse 抱怨 android 布局 xml 文件

[英]Eclipse complaining about android layout xml file

So I'm new to android and am working through the tutorial found here http://www.vogella.com/tutorials/Android/article.html#firstandroidapp , and am at the part where it asks me to change the backgroud color to silver.所以我是 android 的新手,正在完成http://www.vogella.com/tutorials/Android/article.html#firstandroidapp的教程,并且在它要求我将背景颜色更改为的部分银。 When I inserted android:silver="#C0C0C0" , it was giving me the error shown below and it is still giving me the same error even after I remove the line.当我插入android:silver="#C0C0C0" ,它给了我如下所示的错误,即使我删除了该行,它仍然给我同样的错误。

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

So this is my activity_main.xml file.所以这是我的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>

PS I have already tried restarting Eclipse but it still keeps complaining. PS 我已经尝试重新启动 Eclipse,但它仍然不断抱怨。

Try changing尝试改变

android:silver="#C0C0C0"

to

android:background="#C0C0C0"

It's它是

android:background

not "backGround".不是“背景”。 Maybe it can help.也许它可以提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM