您好,登錄后才能下訂單哦!
在RadioButton控件中,通常圖標(biāo)位于文本的前面。要改變圖標(biāo)的位置,可以使用自定義布局來(lái)實(shí)現(xiàn)。以下是一種常見(jiàn)的方法:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<layer-list>
<item android:drawable="@drawable/ic_checked" android:gravity="center_vertical|start"/>
</layer-list>
</item>
<item android:state_checked="false">
<layer-list>
<item android:drawable="@drawable/ic_unchecked" android:gravity="center_vertical|start"/>
</layer-list>
</item>
</selector>
<RadioButton
android:id="@+id/radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/custom_radio_button"
android:text="RadioButton"/>
通過(guò)以上步驟,就可以改變RadioButton控件圖標(biāo)的位置。如果有其他需求,也可以使用其他方式自定義RadioButton的外觀。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。