2013-03-06 2 views
1

안녕하세요. 저는 Android 프로그래밍에 익숙하지 않고 include 태그로 게임하고 있습니다. 그러나이 homepage 레이아웃에 이미지를 추가하지 않습니다포함 지시문에 필수 내용이 포함되어 있지 않습니다.

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:fillViewport="true"> 
    <RelativeLayout 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" android:background="#ffffff"> 
     <include layout="@layout/companylogo" /> 
    </RelativeLayout> 
</ScrollView> 

:로 보이는 homepage 이름

<?xml version="1.0" encoding="utf-8"?> 

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:orientation="vertical" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent"> 
    <!-- Logo Start--> 
    <ImageView android:src="@drawable/logo2" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="10dip"/> 
</LinearLayout> 

및 기타 레이아웃 파일 :

은 나뿐만 companylogo라는 이름의 레이아웃을 가지고있다.

나는 심지어 android:layoutwidth/height 태그를 추가하려고 시도했습니다. 내가 실수를 저지르고 있는지 잘 모르겠다. 사전에

감사합니다.

+0

이'homepage' 레이아웃 – vokilam

+0

를 게시를하면 이름, +1, :) :) :) –

+0

@vokilam 거기에 투표했다 : 질문을 업데이트했습니다. – batman

답변

0

을 사실 우리는 우리의 코드로 XML을 구현할 때, 우리는 프로젝트 몇 번을 청소해야 레이아웃의 효과를 표시합니다.

또한 layout_width 및 layout_height 속성을 모두 포함 태그에 추가하려고합니다.

프로젝트를 청소 시도하고 그것은 여전히 ​​다음

청산 이클립스 작동하지 않은 경우, 그냥 다시 열어, 그것은했다. 자세한 내용은

이 링크를 확인하십시오

android include tag - invalid layout reference

Does Android XML Layout's 'include' Tag Really Work?

0

지금이 다시 한번 시도 :

<include layout="@layout/companylogo" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content"/> 
관련 문제