2011-12-23 4 views
2

안드로이드에서 R.java를 수정하려고했습니다. 내가 생성 된 자바 파일을 삭제했습니다. 저장 한 후에는 아무 것도 변경하지 않는 것 같습니다.R.java를 수정할 수 없습니다.

/* AUTO-GENERATED FILE. DO NOT MODIFY.  
* 
* This class was automatically generated by the 
* aapt tool from the resource data it found. It 
* should not be modified by hand. 
*/ 
public final class R { 
public static final class attr { 
} 

public static final class color { 
    public static final int notepad_lines=0x7f040001; 
    public static final int notepad_margin=0x7f040002; 
    public static final int notepad_paper=0x7f040000; 
    public static final int notepad_text=0x7f040003; 
} 
public static final class drawable { 
    public static final int icon=0x7f020000; 
} 
public static final class id { 
    public static final int myEditText=0x7f050000; 
    public static final int myListView=0x7f050001; 
} 
public static final class layout { 
    public static final int colors=0x7f030000; 
    public static final int dimens=0x7f030001; 
    public static final int main=0x7f030002; 
} 
public static final class string { 
    public static final int app_name=0x7f040001; 
    public static final int hello=0x7f040000; 
} 
} 

그것은 너무 실망 나는 그것을 저장할 때마다, 그것은 다시 간다 : 내가 원하는이

/* AUTO-GENERATED FILE. DO NOT MODIFY. 
* 
* This class was automatically generated by the 
* aapt tool from the resource data it found. It 
* should not be modified by hand. 
*/ 
public final class R { 
public static final class attr { 
} 
public static final class drawable { 
    public static final int icon=0x7f020000; 
} 
public static final class id { 
    public static final int myEditText=0x7f050000; 
    public static final int myListView=0x7f050001; 
} 
public static final class layout { 
    public static final int colors=0x7f030000; 
    public static final int dimens=0x7f030001; 
    public static final int main=0x7f030002; 
} 
public static final class string { 
    public static final int app_name=0x7f040001; 
    public static final int hello=0x7f040000; 
} 
} 

가이를 변경하는 것이 더이 하나처럼되고처럼 내가 가지고있는 R.java 파일이 보인다 자동으로 생성되기 때문에 이전 상태입니다. 어떻게 수정합니까?

+0

왜 어쨌든 이것을하고 싶습니까? –

+0

그냥이 프로젝트를 사용자 정의하려고하는데 – Yahyaotaif

+2

값/color.xml을 사용하여 해당 색상을 생성합니다. – Joe

답변

1

R.java는 프로젝트에서 사용되는 모든 리소스를 포함하는 자동 생성 파일입니다. R.java를 변경하려면 할 수 없습니다.

리소스를 추가 또는 삭제해야하며 프로젝트에있는 리소스에 따라 리소스가 수정됩니다.

이것은 Android에서 기본적인 것입니다. 당신은 안드로이드 개발자 문서를 읽어야합니다, 그리고 당신은 그것에 대해 좋은 지식을 얻을 것이다.

1
당신은 우리가 XML 파일을 개발할 때 자동으로 생성됩니다 안드로이드에 R.java를 수정할 수 없습니다

.... 그래서 우리는 그것을 수정할 수 없습니다 여기에 ID 번호가 다른보기로 저장됩니다 ..

+0

내가 알아 낸 것은 xml 파일을 res/values ​​/ colors.xml. 그런 다음 입력하십시오 # AAFFFF99 ... Yahyaotaif

관련 문제