2012-11-21 5 views
0

나는 main.xml 파일과 cell_shape.xml 파일을 가지고있다. 내 main.xml에있는하나의 XML 파일을 다른 XML 파일로 가져 오는 방법

내가 내가이 오류

Exception raised during rendering: You must specify a valid layout 
reference. The layout ID @layout/cell_shape is not valid. Couldn't 
resolve resource @layout/cell_shape Exception details are logged in 
Window > Show View > Error Log 

했다이

<?xml version="1.0" encoding="utf-8"?> 
    <shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/tables" 
    android:shape= "rectangle" > 
     <solid android:color="#000"/> 
     <stroke android:width="1dp" android:color="#ff9"/> 
</shape> 

했다 나의 cell_shape.XML이

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="wrap_content" 
android:layout_height="fill_parent" 
android:weightSum="100" > 

<include 
    android:id="tables" 
    layout="@layout/cell_shape" /> 

이 있고 난 몰라 내 main.xml 인 경우 올바르게 가져올 수있는 방법을 이해하십시오.

에는 하나의 XML 파일에서 다른 요소로 다른 요소를 가져 오는 방법에 대한 자습서가 있습니까?

답변

0

이없는없는 경우 include에서 id을 제거하려고, 그래서 그냥 다음과 같습니다

<include 
    layout="@layout/cell_shape" /> 

작동하지 않는 경우

, 하나의 LinearLayout 또는 다른 유형의 레이아웃으로 전체 cell_shape를 둘러보십시오.

그건 그렇고, 안드로이드 디자인의 균일성에 대해서는 this Android site의 색상을 사용하십시오.

관련 문제