2013-01-19 3 views
1

두 개의 레이아웃 파일을 만들었습니다. 그것의 모습에서이 XMLxml 파일 대 xml 레이아웃

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 


</LinearLayout> 

및 안드로이드 XML 파일

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 


</LinearLayout> 

을 만들어

안드로이드 XML 레이아웃 파일은 모두 동일합니다. 둘 다 동일한 XML을 생성하기 때문에 다른 것을 사용할 때?

답변

0

그래, 그들은 같은 prograticaly 있으며, xml의 다른 유형이 없습니다. 중요한 것은 xml (레이아웃, 값, ...)의 위치입니다.

이클립스에서 IDE보기에 약간의 차이가있을 수 있습니다. 레이아웃 파일 대신 Android XML 파일을 만들면 그래픽 레이아웃보기가 있는지 확실하지 않습니다. 이보기를 추가 할 수 있습니다.))

결과 apk는 동일합니다.

0

Android XML을 사용하는 이유는 레이아웃 도구 (GUI 레이아웃 편집기)를 사용하려는 경우입니다. Eclipse IDE는이 파일에 대해 다르게 반응합니다.

하지만 코드는 동일하므로 작성하는 APK도 동일하므로 최종 출력에는 문제가되지 않습니다.

나는 항상 Android XML 파일을 사용하므로 ADT 도구에 더 잘 통합됩니다.

관련 문제