當前位置:編程學習大全網 - 網站源碼 - 安卓UI自定義radiobutton樣式

安卓UI自定義radiobutton樣式

自定義RadioButton樣式分為兩步:

1、自定義好樣式:

?打開style.xml,添加壹個item

<style?name="RadiobuttonStyle">

<item?name="android:gravity">center</item>

<item?name="android:textSize">16sp</item>

<item?name="android:textColor">@color/text_select_color</item>

<item?name="android:button">@null</item>

<item?name="android:drawableTop">@drawable/select_rbtn_home</item>

</style>

2、在RadioButon中引用:

<RadioButton

android:id="@+id/tv_tab_home"

style="@style/RadiobuttonStyle"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:checked="true"

android:text="@string/tab_home"?/>

  • 上一篇:關於肖申克的救贖的幾個問題
  • 下一篇:學習反匯編有什麽用
  • copyright 2024編程學習大全網