我有一個佈局菜單,其中包含此:<include>標籤不能準確顯示它的內容
<RelativeLayout android:id="@+id/computersMenu"
android:layout_width="50dp"
android:layout_height="50dp">
<include layout="@layout/component_add_button"
android:id="@+id/imagebutton_add_client"/>
</RelativeLayout>
component_add_button.xml:
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_menu_add"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"/>
望着預覽(編輯:我的意思是eclipse中xml編輯器的「Graphical Layout」選項卡,它使用與component_add_button.xml的所有設備AFAIK相同的呈現引擎,您可以看到該圖像。大。在包含它的頁面上,它不顯示(雖然它給你一個可選擇的圖像空間)。
這似乎是一個非常簡單的例子,「應該只是工作」。包含標籤對我來說一直顯得非常脆弱 - 我想知道如果我錯過了它的實際工作方式......?
如果您的意思是eclipse中的ADT UI設計器使用「預覽」 - 在真實設備或模擬器上測試您的佈局。這些工具已經改進,但它們仍然不適用於imho。 Lot的東西不能正確顯示,包括聽起來像是候選人。 – 2011-09-19 11:18:10
我可以確認在ADT中的預覽沒有嵌套預覽我上次查看 – Merlin
從包含標記中刪除id部分並將其放置在ImageView中。 –