如何在 Android Studio 中以 XML 格式匯入類 android.graphics.drawable.shapes.Shape?我收到“無法決議類形狀”。
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
</shape>
uj5u.com熱心網友回復:
我認為代碼中沒有任何問題。你為什么不檢查這些東西。
- 你在 res/drawable/something.xml 里寫了代碼嗎?您必須在該
something部分撰寫自己的檔案名。 <?xml version="1.0" encoding="utf-8"?>頂部沒有。
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
</shape>
- 做清理,重建專案。
- 做無效快取/重啟。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/392343.html
