0
我發現了很多這樣的例子,並且據我所知我做得很對,但仍然出現錯誤。我創建了一個border.xml文件,並將其放入可繪製文件夾中。該文件夾不存在,所以我不得不創建它。我有一種感覺,我的問題是我保存文件的位置,或者可能需要在某處註冊。在這裏你可以看到文件。 嘗試將邊框添加到TableRow時出錯
這裏是border.xml
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffffff" />
<stroke android:width="2dp" android:color="#515151"/>
<corners android:radius="3dp" />
<padding android:left="10dp" android:top="5dp"
android:right="10dp" android:bottom="5dp" />
</shape>
的代碼,這裏是我想要使用它
<TableRow
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/border.xml"
android:padding="5dp">
我得到的錯誤是:
error: Error: No resource found that matches the given name (at 'background' with value
'@drawable/border.xml').