【发布时间】:2011-07-14 15:07:54
【问题描述】:
我尝试复制几个不同的示例,使用形状布局,尝试图像等。无论我做什么,尽管背景可绘制对象被简单地忽略了。我故意将错误放入可绘制的 xml 以确保它被看到,这触发了错误。我在 res/drawable 中有我的可绘制内容。
有什么想法吗?
<Button android:id="@+id/buttonClose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test"`enter code here`
android:padding="5dip"
android:layout_gravity="center"
android:layout_alignParentBottom="true"
android:onClick="closeScoreBoard"
android:background="@drawable/button_close"
/>
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#FF0000"/>
<corners
android:bottomRightRadius="8dip"
android:bottomLeftRadius="8dip"
android:topLeftRadius="8dip"
android:topRightRadius="8dip"
/>
</shape>
【问题讨论】:
-
你可以为按钮发布你的 XML 吗?
-
请将它们添加到您的问题中并格式化它们以便于阅读。
-
完成,稍早于您的要求...
-
你的背景是什么?是图像吗?如果有,是什么类型的?您在 LogCat 中看到任何错误吗?
标签: android xml layout drawable