我正在創建一些根元素爲merge
的佈局。在merge
元素內我有一個ScrollView
包含TextView
。下面是該文件:使用合併與佈局給一個文件錯誤,沒有其他錯誤。相同的代碼!
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android="http://schemas.android.com/apk/res/android">
<ScrollView
android:id="@+id/scroll"
android:padding="6dp"
android:layout_below="@id/headingLayout"
android:layout_above="@id/tabsLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/aboutTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</ScrollView>
</merge>
我得到2個錯誤:沒有資源相匹配的layout_below
和layout_above
名字我已經把
我有另一種佈局的xml文件,包括非常相似的成分,有些其中也參考@id/headingLayout
和@id/tabsLayout
。這兩個XML佈局文件中不含有名字headingLayout
或tabsLayout
組件爲什麼一個佈局文件中沒有關於這些引用和其他佈局文件錯誤呢?我做錯了什麼,應用程序會像我期望的那樣構建和運行,直到我將此合併添加到另一個佈局爲止?
我甚至試圖從工作佈局文件中複製xml,發現它給出了相同的錯誤,但是我的新佈局文件必須出錯。我曾嘗試清潔,重建,開/閉日食..
如果它是文件中唯一的頂級標籤,爲什麼需要'merge'標籤內的'ScrollView'? – 2010-09-28 15:14:10
以及如果我的'TextView'變得太大,我不需要滾動? – binnyb 2010-09-28 15:50:45