最近在做一個專案時,由于布局增加了很多 xml,我在布局資源中添加了子檔案夾以使專案結構化,但之后 ButterKnife Injections 不起作用。我收到以下錯誤。
@BindView(R.id.tb_tvcoinsMainCommon) TextView tvCoins;
^
java.lang.annotation.AnnotationTypeMismatchException: Incorrectly typed data found for annotation element public abstract int butterknife.BindView.value() (Found data of type <any>)
findViewById() 沒有出現任何問題,只有 ButterKnife Bindings 出現問題。如果有人有一個有用的解決方案
uj5u.com熱心網友回復:
@Nullable在@Bind可能為空的視圖之前添加注釋。
示例:
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/342890.html
上一篇:使用Php我想知道如何從用戶那里獲取顏色輸入并將該顏色設定為頁面的背景
下一篇:帶有FloatingActionButtonUI的BottomAppBar和BottomNavigationView搞砸了
