小程序開發
APP開發
網站建設
微信開發
技術分享
運營推廣
行業新聞
源碼源著微信
自定義RadioButton樣式并去除默認樣式位置
做項目的遇到要自定義RadioButton的樣式,在網上搜索了很多例子都沒有完美解決,當android:button="@null"的是時 候但它的位置還在,空出了很大一塊,橫向排列的時候不是很美觀。試了很多辦法終于解決了這個小問題就是把背景 也 設 為"@null" 這樣:android:background="@null" ,就可以了 它的也就沒有了 空出的很大部分也沒有 了。 全部代碼: [mw_shl_code=xhtml,true] android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="horizontal" android:paddingBottom="15dp" android:paddingTop="15dp" > android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="5dp" android:text="保額" android:textColor="#363636" android:textSize="18sp" /> android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="5dp" android:background="@null" android:button="@null" android:drawableLeft="@drawable/radio_selector" android:singleLine="true" android:text="10萬" android:textColor="#2991a5" android:textSize="18sp" /> android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="5dp" android:background="@null" android:button="@null" android:drawableLeft="@drawable/radio_selector" android:singleLine="true" android:text="20萬" android:textColor="#2991a5" android:textSize="18sp" /> android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="5dp" android:background="@null" android:button="@null" android:drawableLeft="@drawable/radio_selector" android:singleLine="true" android:text="50萬" android:textColor="#2991a5" android:textSize="18sp" /> android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="5dp" android:background="@null" android:button="@null" android:drawableLeft="@drawable/radio_selector" android:singleLine="true" android:text="100萬" android:textColor="#2991a5" android:textSize="18sp" /> [/mw_shl_code]
文章分類
推薦文章
2025-01-18
2024-11-28
2024-11-09
2024-10-25
2024-06-25
2024-01-04
2023-11-06
2023-10-30
2023-10-13
2023-10-10
穩定
貼心
專業
快速
承諾
堅持
方案
資訊
聯系我們
關于我們
友情鏈接: