Java 为什么';按钮上是否有可拉拔的apears?
我是Java Android开发的新手。 我想在一个像巴顿背景的视图上添加这个可绘制的 但它没有画任何东西 这是我的背景drawable_shining.xml:Java 为什么';按钮上是否有可拉拔的apears?,java,android,xml,Java,Android,Xml,我是Java Android开发的新手。 我想在一个像巴顿背景的视图上添加这个可绘制的 但它没有画任何东西 这是我的背景drawable_shining.xml: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <shape> <g
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape>
<gradient
android:endColor="#000"
android:centerColor="#111"
android:startColor="#000"
android:angle="45"
android:type="linear" />
</shape>
</item>
<item>
<shape>
<gradient
android:endColor="#000"
android:gradientRadius="100"
android:startColor="#555"
android:type="radial" />
</shape>
</item>
</layer-list>
[here is code and layout][1]
[这是代码和布局][1]
您可以使用与以下代码相同的格式:
参考:
根据文档,是一个可绘制对象,用于管理其他可绘制对象的数组。列表中的每个可绘制项都是按照列表的顺序绘制的,列表中最后一个可绘制项是在顶部绘制的 每个可绘制元素由单个元素中的一个元素表示 在代码中,将每个
写在
标记中。您的最终代码如下所示
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape>
<gradient
android:endColor="#000"
android:gradientRadius="100"
android:startColor="#333"
android:type="radial" />
</shape>
</item>
<item>
<shape>
<gradient
android:endColor="#000"
android:gradientRadius="100"
android:startColor="#333"
android:type="radial" />
</shape>
</item>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape>
<gradient
android:endColor="#000"
android:gradientRadius="100"
android:startColor="#333"
android:type="radial" />
</shape>
</item>
<item>
<shape>
<gradient
android:endColor="#000"
android:gradientRadius="100"
android:startColor="#333"
android:type="radial" />
</shape>
</item>