【发布时间】:2019-07-21 22:22:11
【问题描述】:
这三个xml文件在android中有什么区别?
以选择器为根元素的xml文件
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<Further Designing ... />
...
</shape>
</item>
</selector>
以形状为根元素的xml文件
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<Further Designing ... />
...
</shape>
以层列表为根元素的xml文件
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<Further Designing ... />
...
</shape>
</item>
<item android:bottom="1dp">
<shape android:shape="rectangle">
<Further Designing ... />
...
</shape>
</item>
</layer-list>
在哪种情况下使用哪个。一些小例子将不胜感激。谢谢!!!
【问题讨论】:
标签: android android-layout android-xml android-shape