2011-03-09 6 views
0

AdMob 광고 참조를 탭보기 위에 놓으려고하면 "XML 파일 구문 분석 오류 : 언 바운드 접두사"가 표시됩니다. 어떤 생각을 고치는 방법? 당신이 사용하고TabbedView 위에 AdMob 광고를 추가 하시겠습니까?

<?xml version="1.0" encoding="utf-8"?> 
<TabHost xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@android:id/tabhost" android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
    <LinearLayout android:orientation="vertical" 
     android:layout_width="fill_parent" android:layout_height="fill_parent" 
     android:padding="5dp"> 
     <com.admob.android.ads.AdView android:id="@+id/ad" 
      android:layout_width="fill_parent" android:layout_height="wrap_content" 
      myapp:backgroundColor="#000000" myapp:primaryTextColor="#FFFFFF" 
      myapp:secondaryTextColor="#CCCCCC" /> 
     <TabWidget android:id="@android:id/tabs" 
      android:layout_width="fill_parent" android:layout_height="wrap_content" /> 
     <FrameLayout android:id="@android:id/tabcontent" 
       android:layout_width="fill_parent" android:layout_height="fill_parent" 
      android:padding="5dp" /> 
    </LinearLayout> 
</TabHost> 

답변

2

:

myapp:backgroundColor 

하지만 난 'MyApp를'접두사의 선언을 볼 수 없습니다. 그래서 그 오류의 원인이 될 수 있습니다. 은 "안드로이드"네임 스페이스가이 같은 XML에 선언 된 것처럼

:

xmlns:android="http://schemas.android.com/apk/res/android" 

'MyApp를'네임 스페이스 곳도

+0

물론 당신 말이 맞아요. 나는 그것을 완전히 놓쳤습니다. * 한숨 * 고마워. 그게 프로젝트 사이에서 일하는 문제입니다 ... xmlns : myapp = "http://schemas.android.com/apk/res/com.package.namespace" –

+1

:) 왜 내가 그것을 알고 있다고 생각합니까?> 내 일을 마쳤습니다. 이것의 공유;) .... 대부분 안드로이드 선언하지 않습니다 : 접두사, 또는 너무 늦게 선언 : – Nanne

1

This answer이 관련된 것 같다 선언이 있어야합니다.

Nanne의 말처럼 xmlnsres/style/attrs.xml에 정의 된 속성이 모두 올바르게 설정되어 있어야합니다. xmlns

가 나타납니다 : 예 attrs.xml를 들어

xmlns:admob="http://schemas.android.com/apk/res/com.example.package"

위의 답을 확인하십시오.

+0

또한 수정합니다. 다행스럽게도 attrs.xml이 이미 존재하도록 기존 프로젝트를 탭 인터페이스로 수정하고있었습니다. 그렇지 않으면 나를 확실히 넘어 뜨 렸을 것입니다. –

관련 문제