在Android開(kāi)發(fā)中經(jīng)常會(huì)需要用到帶文字和圖片的button,下面來(lái)給大家介紹使用radiobutton實(shí)現(xiàn)圖片和文字上下布局或左右布局。代碼很簡(jiǎn)單就不給大家多解釋了。
布局文件很簡(jiǎn)單,用來(lái)展示RadioBUtton的使用方法。
<?xml version="." encoding="utf-"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:button="@null" android:drawableTop="@drawable/ic_launcher" android:text="Test Button" /> </RelativeLayout>
效果圖如下

以上代碼我沒(méi)有寫(xiě)注釋?zhuān)嘈糯蠹叶伎梢钥炊?,關(guān)于以上代碼有任何問(wèn)題歡迎給我留言,我會(huì)在第一時(shí)間和大家聯(lián)系的。謝謝大家。
新聞熱點(diǎn)
疑難解答
圖片精選