2017-05-26 72 views
0

我得到android.content.res.Resources $ NotFoundException:prelollipop設備中的錯誤。以下是我的代碼片段。我正在使用矢量圖標。如何解決這個問題?我不想使用PNG的圖標。seticon()在標籤佈局崩潰prelollipop

​​

EDIT1:我嘗試包裹在layerlist繪圖資源,但它仍然沒有工作 EDIT2:我刪除選擇,簡單地設置在操作SetIcon一個layerlist()仍然崩潰

+0

你在gradle.file中啓用了對vectordrawable的支持嗎? – MatPag

+0

yes ..他們(矢量)無處不在 –

+0

vectorDrawables.useSupportLibrary = true –

回答

0

嘗試使用此

tabCall1.setIcon(ContextCompat.getDrawable(your_context, R.drawable.tab1_selector)); 
+0

好吧,我會試試這個 –

+0

同樣的錯誤資源$ NotFoundException:文件res/drawable/tab1_selector.xml來自可繪製資源ID#0x7f020169 –