2016-02-27 180 views
2

我試過在新的簡單EmptyActivity項目中添加ImageView。我無法在xml文件中爲ImageView添加Id。我有一條消息<interface declaration>, <parcelable declaration>, AidlTokenType.import or AidlToken.package expected, got '@'。我可以毫無問題地爲按鈕和TextView添加Id。 的Android 1.5.1工作室爲什麼我無法在xml文件中爲ImageView添加ID

enter image description here

+0

您是否嘗試清理該項目? –

+0

@vasilis是的,我已經嘗試清理我的項目 – Malder

+0

看起來像一些奇怪的錯誤,你有沒有嘗試過AS 2.0測試版之一? –

回答

4

我發動了對其它筆記本電腦的Android Studio來比較的設置。我打開首選項 - >編輯器 - >語言注入。我不知道它是如何發生的,但我的android studio有錯誤的語言注入「xml:ImageView/@ id」。我刪了它。現在一切都按我想要的那樣工作。

enter image description here

+0

Tnx,它解決了我的問題:-) – AndreaNobili

+0

用@string資源解決了我的類似問題 – kolombo

相關問題