【发布时间】:2011-10-19 22:15:39
【问题描述】:
我已经自定义了具有特定背景的原始单选按钮并删除了按钮:
styles.xml:
<style name="echelle_relecture">
<item name="android:background">@drawable/btn_relecture_echelle</item>
<item name="android:button">@null</item>
<item name="android:layout_gravity">center_horizontal</item>
</style>
radio.xml:
<RadioGroup android:layout_height="wrap_content" android:id="@+id/radioGroup1" android:layout_width="fill_parent" android:orientation="horizontal" android:layout_marginTop="10dp">
<RadioButton style="@style/echelle_relecture" android:text="@string/day" android:id="@+id/jour" android:checked="true"></RadioButton>
<RadioButton style="@style/echelle_relecture" android:text="@string/hour" android:id="@+id/hour" android:button="@null"></RadioButton>
<RadioButton style="@style/echelle_relecture" android:text="@string/min" android:id="@+id/mins" android:button="@null" android:enabled="false"></RadioButton>
</RadioGroup>
尽管有“center_horizontal”参数,但我无法让文本在按钮内居中。我该怎么做?
【问题讨论】:
标签: android radio-button