Android代碼實(shí)現(xiàn)圖片和文字上下布局
在Android開發(fā)中經(jīng)常會(huì)需要用到帶文字和圖片的button,下面來給大家介紹使用radiobutton實(shí)現(xiàn)圖片和文字上下布局或左右布局。代碼很簡(jiǎn)單就不給大家多解釋了。
布局文件很簡(jiǎn)單,用來展示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>
效果圖如下

以上代碼我沒有寫注釋,相信大家都可以看懂吧,關(guān)于以上代碼有任何問題歡迎給我留言,我會(huì)在第一時(shí)間和大家聯(lián)系的。謝謝大家。
- Android App仿QQ制作Material Design風(fēng)格沉浸式狀態(tài)欄
- Android實(shí)現(xiàn)沉浸式通知欄通知欄背景顏色跟隨app導(dǎo)航欄背景顏色而改變
- Android沉浸式狀態(tài)欄實(shí)現(xiàn)
- 另外兩種Android沉浸式狀態(tài)欄實(shí)現(xiàn)思路
- Android 實(shí)現(xiàn)沉浸式狀態(tài)欄的方法
- android 線性布局LinearLayout實(shí)例代碼
- android LinearLayout 布局實(shí)例代碼
- android layout 按比例布局的代碼
- Android在代碼中設(shè)置沉浸式布局的方法
相關(guān)文章
Android開發(fā)實(shí)現(xiàn)消除屏幕鎖的方法
這篇文章主要介紹了Android開發(fā)實(shí)現(xiàn)消除屏幕鎖的方法,結(jié)合實(shí)例形式較為詳細(xì)的分析了Android鎖屏的原理及消除屏幕鎖的相關(guān)操作技巧,需要的朋友可以參考下2017-09-09
Android開發(fā)之ViewFlipper自動(dòng)播放圖片功能實(shí)現(xiàn)方法示例
這篇文章主要介紹了Android開發(fā)之ViewFlipper自動(dòng)播放圖片功能實(shí)現(xiàn)方法,結(jié)合實(shí)例形式分析了Android使用ViewFlipper實(shí)現(xiàn)圖片播放的相關(guān)界面布局及功能實(shí)現(xiàn)技巧,需要的朋友可以參考下2019-03-03
android之HttpPost&HttpGet使用方法介紹
下文直接講用法,先知道怎么用,再知道怎么回事,具體如下,感興趣的朋友可以參考下哈2013-06-06
Android利用Palette實(shí)現(xiàn)提取圖片顏色
Palette是一個(gè)類似調(diào)色板的工具類,根據(jù)傳入的bitmap,提取出主體顏色,使得圖片和顏色更加搭配,界面更協(xié)調(diào)。本文將詳解如何利用Palette實(shí)現(xiàn)提取圖片顏色,需要的可以參考一下2022-03-03
ImageView點(diǎn)擊可變暗的實(shí)例代碼(android代碼技巧)
本文給大家分享一段實(shí)例代碼給大家介紹ImageView點(diǎn)擊可變暗的實(shí)例代碼,非常不錯(cuò),具有參考借鑒價(jià)值,需要的的朋友參考下吧2017-02-02
Android開發(fā)在RecyclerView上面實(shí)現(xiàn)"拖放"和"滑動(dòng)刪除"-2
這篇文章主要介紹了Android開發(fā)在RecyclerView上面實(shí)現(xiàn)"拖放"和"滑動(dòng)刪除"(二)功能,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2017-03-03

