欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

自定義RadioButton樣式1

系統(tǒng) 1629 0


主要是布局:
    
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
	<RadioGroup android:gravity="center"
		android:layout_gravity="bottom" 
		android:orientation="horizontal"
		android:layout_width="fill_parent" 
		android:layout_height="wrap_content" >
		<RadioButton 
		    android:id="@+id/btn_0"
			android:textSize="17.0sp" 
			android:textColor="@android:color/black"
			android:text="搜索微博"
			android:layout_weight="1" 
			android:button="@null"
			android:checked="true"
			android:drawableLeft="@drawable/state_radio"
			android:background="@drawable/state_btn"
			android:gravity="center_vertical"
			>
		</RadioButton>
		<RadioButton 
		    android:id="@+id/btn_1"
			android:textSize="17.0sp" 
			android:textColor="@android:color/black"
			android:text="搜索用戶"
			android:layout_weight="1" 
			android:button="@null"
			android:drawableLeft="@drawable/state_radio"
			android:background="@drawable/state_btn"
			android:gravity="center_vertical"
			>
		</RadioButton>
	</RadioGroup>
</LinearLayout>

  

其中state_radio.xml
    
<?xml version="1.0" encoding="utf-8"?>
<selector
	xmlns:android="http://schemas.android.com/apk/res/android"
	>
	<item
		android:state_focused="false"
		android:state_checked="false"
		android:state_pressed="false"
		android:drawable="@drawable/bg_radio"
		>
	</item>
	<item
		android:state_focused="false"
		android:state_checked="true"
		android:state_pressed="false"
		android:drawable="@drawable/bg_radio_selected"
		>
	</item>
	<item
		android:state_focused="true"
		android:state_checked="false"
		android:state_pressed="false"
		android:drawable="@drawable/bg_radio_onfocus"
		>
	</item>
	<item
		android:state_focused="true"
		android:state_checked="true"
		android:state_pressed="false"
		android:drawable="@drawable/bg_radio_onfocus_selected"
		>
	</item>
</selector>

  

state_btn.xml:
    
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> 
       <item android:state_window_focused="false"      
             android:drawable="@drawable/bg_btn"/>  
       <item android:state_focused="true" android:state_pressed="true"         
             android:drawable="@drawable/bg_btn_selected" />  
       <item android:state_focused="false" android:state_pressed="true"    
             android:drawable="@drawable/bg_btn_selected" />  
</selector>

  


上面的寫(xiě)法有點(diǎn)拖沓,采用style可能會(huì)更簡(jiǎn)單:
    
<?xml version="1.0" encoding="utf-8"?> 
<resources> 
<style name="CustomTheme" parent="android:Theme"> 
   <item name="android:radioButtonStyle">@style/RadioButton</item> 
</style> 
<style name="RadioButton" parent="@android:style/Widget.CompoundButton.RadioButton"> 
   <item name="android:button">@drawable/radio</item> 
</style> 
</resources> 

  

radio.xml:
    
<?xml version="1.0" encoding="utf-8"?> 
<selector xmlns:android="http://schemas.android.com/apk/res/android"> 
    <item android:state_checked="true" android:state_window_focused="false" 
        android:drawable="@drawable/radio_hover" /> 
    <item android:state_checked="false" android:state_window_focused="false" 
        android:drawable="@drawable/radio_normal" /> 
    <item android:state_checked="true" android:state_pressed="true" 
        android:drawable="@drawable/radio_active" /> 
    <item android:state_checked="false" android:state_pressed="true" 
        android:drawable="@drawable/radio_active" /> 
    <item android:state_checked="true" android:state_focused="true" 
        android:drawable="@drawable/radio_hover" /> 
    <item android:state_checked="false" android:state_focused="true" 
        android:drawable="@drawable/radio_normal_off" /> 
    <item android:state_checked="false" android:drawable="@drawable/radio_normal" /> 
    <item android:state_checked="true" android:drawable="@drawable/radio_hover" /> 
</selector> 

  


實(shí)現(xiàn)分?jǐn)郆utton,模仿MIUI設(shè)置頁(yè)面頂部Button
http://blog.csdn.net/hudan2714/article/details/8228173

自定義RadioButton樣式1


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 日本美女毛茸茸 | 色洛色中文综合网站 | 午夜看片网 | 欧洲精品视频在线观看 | 高清国产激情视频在线观看 | 国产成人三级 | 亚洲成a人在线观看 | 99精品在线观看 | 2020天天狠天天透天干天天怕 | 久久这里只有精品9 | 欧美精品第一页 | 精品无人乱码高清 | 日韩不卡一区二区 | 午夜影院在线观看版 | 国产尤物视频 | 国产精品福利视频免费观看 | 一级黄色a视频 | 国产日产精品久久久久快鸭 | 亚洲啊v在线观看 | 91欧美精品激情在线观看 | 欧美成人影院在线观看三级 | 2021国产精品一区二区在线 | 久久久久性视频 | 中文字幕日本电影 | 欧美一级二级三级 | 亚洲欧洲日韩国产aa色大片 | 国产成人精品三级 | 国产精品尤物 | 久久一区二区三区免费 | 色婷婷国产精品欧美毛片 | 欧美成人在线免费观看 | 在线中文天堂 | 亚洲综合首页 | 激情五月色婷婷 | 亚洲免费人成在线视频观看 | 精品国产三级 | 激情丁香开心久久综合 | 久久这里只有精品国产99 | 国产xxxx搡xxxxx搡麻豆 | 午夜成人免费视频 | 亚洲不卡视频 |