2011-05-31 25 views
1

我想为RadioButton的drawable按钮创建一个自定义drawable。如何为RadioButton定义shape.xml?

我已经创建了一个主题和样式,它指向RadioButton的按钮,绘制到在XML中定义的自定义绘图。

的drawable.xml看起来是这样的:

<android:shape xmlns:android="http://schemas.android.com/apk/res/android" shape="oval"> 
    <android:solid color="#ffffffff"/> 
</android:shape> 

但这显示空白区里的按钮应该是。

我尝试添加一个尺寸参数,以及:

<android:shape xmlns:android="http://schemas.android.com/apk/res/android" shape="oval"> 
    <android:solid color="#ffffffff"/> 
    <android:size width="16dip" height="16dip" /> 
</android:shape> 

但与没有运气无论是。

回答

3

这是我的一个愚蠢的错误!我错过了color和其他属性上的android:名称空间限定符。

下正常工作:

<android:shape xmlns:android="http://schemas.android.com/apk/res/android" shape="oval"> 
    <android:solid android:color="#ffffffff"/> 
    <android:size android:width="16dip" android:height="16dip" /> 
</android:shape> 
+0

可以还张贴样式的代码? – 2013-08-21 07:36:07