Android 如何为/drawable/*.xml指定目标类型?
我有两种不同的“样式”(边框宽度和颜色),我想应用于EditText和ImageView。他们建议我将它们添加到drawable/my_shape.xml中Android 如何为/drawable/*.xml指定目标类型?,android,Android,我有两种不同的“样式”(边框宽度和颜色),我想应用于EditText和ImageView。他们建议我将它们添加到drawable/my_shape.xml中 <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" ......> <solid android:color="#FFFFFF
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
......>
<solid android:color="#FFFFFF" />
<stroke ..... />
<padding .... />
</shape>
- create different border width and colour for ImageView and EditText? Should I somehow specify a target type?
- as far as I understand, those "styles" will be applied to ... each control?
- how can I apply them to a particular EditText or ImageView?