Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何为/drawable/*.xml指定目标类型?_Android - Fatal编程技术网

Android 如何为/drawable/*.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

我有两种不同的“样式”(边框宽度和颜色),我想应用于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" />
  <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?