手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >Android代码实现图片和文字上下布局
Android代码实现图片和文字上下布局
摘要:在Android开发中经常会需要用到带文字和图片的button,下面来给大家介绍使用radiobutton实现图片和文字上下布局或左右布局。...

在Android开发中经常会需要用到带文字和图片的button,下面来给大家介绍使用radiobutton实现图片和文字上下布局或左右布局。代码很简单就不给大家多解释了。

布局文件很简单,用来展示RadioBUtton的使用方法。

<" 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>

效果图如下

Android代码实现图片和文字上下布局1

以上代码我没有写注释,相信大家都可以看懂吧,关于以上代码有任何问题欢迎给我留言,我会在第一时间和大家联系的。谢谢大家。

【Android代码实现图片和文字上下布局】相关文章:

android实现上下滚动的TextView

Android 混淆代码详解及实例

Android实现自定义带文字和图片Button的方法

Android 加载大图片时内存溢出怎么办

android书架效果实现原理与代码

Android中3种图片压缩处理方法

Android开发之串口编程原理和实现方式

Android的ImageButton当显示Drawable图片时就不显示文字

Android开发之相对布局

Android开发之线性布局

精品推荐
分类导航