一、Button和ImageButton特证:

  1、共同特证:

    都可以作为一个按钮产生点击事件

  2、不同特证:

    Button有text的属性,ImageButton没有

    ImageButton有src属性,Button没有

二、布局文件中设置Button和ImageButton控件

  <Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/login" /> <Button
android:id="@+id/button2"
style="?android:attr/buttonStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/login"
android:background="#ff00ff" /> <ImageButton
android:id="@+id/imageButton1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" /> <ImageButton
android:id="@+id/imageButton1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ic_launcher" />

Android控件之Button(按钮控件)和ImageButton(图片按钮控件)的更多相关文章

  1. Android实现图片滚动控件,含页签功能,让你的应用像淘宝一样炫起来

    首先题外话,今天早上起床的时候,手滑一下把我的手机甩了出去,结果陪伴我两年半的摩托罗拉里程碑一代就这么安息了,于是我今天决定怒更一记,纪念我死去的爱机. 如果你是网购达人,你的手机上一定少不了淘宝客户 ...

  2. [CSS]Input标签与图片按钮对齐

    页面直接摆放一个input文本框与ImageButton图片按钮,但是发现没有对齐: <input type="text" id="txtQty" /&g ...

  3. 【读书笔记《Android游戏编程之从零开始》】3.Android 游戏开发常用的系统控件(Button、Layout、ImageButton)

    3.1 Button Button这控件不用多说,就是一个按钮,主要是点击后进行相应事件的响应. 给组件添加ID属性:定义格式为 android:id="@+id/name",这里 ...

  4. 【Android开发日记】之入门篇(十四)——Button控件+自定义Button控件

        好久不见,又是一个新的学期开始了,为什么我感觉好惆怅啊!这一周也发生了不少事情,节假日放了三天的假(好久没有这么悠闲过了),实习公司那边被组长半强制性的要求去解决一个后台登陆的问题,结果就是把 ...

  5. android基本控件学习-----Button

    Button讲解: 一.在我们实际的使用button的时候经常会对button不同状态会有不同的显示,在讲解Button前,首先对drawable下面的statelistdrawable的相关知识讲一 ...

  6. 【Android】10.0 UI开发——如何编写程序界面、常见控件的使用

    ************************ 转载请注明出处:https://www.cnblogs.com/xiaofu007/p/10331880.html ***************** ...

  7. ASP.NET控件<ASP:Button /> html控件<input type="button">区别联系

    ASP.NET控件<ASP:Button />-------html控件<input type="button">杨中科是这么说的:asp和input是一样 ...

  8. Android 使用代码主动去调用控件的点击事件(模拟人手去触摸控件)

    使用代码主动去调用控件的点击事件(模拟人手去触摸控件) //View 可以是LinearLayout,Button,TextView View.performClick();

  9. winform中button点击后再点击其他控件致使button失去焦点,此时button出现黑色边线,去掉黑色边线的方法

    winform中button点击后再点击其他控件致使button失去焦点,此时button出现黑色边线,去掉黑色边线的方法 button的FlatAppearence属性下,设置BorderSize= ...

随机推荐

  1. 20151224001 GridView 多按钮的各种使用方法

    <asp:GridView ID="GridView1"                 runat="server" AllowPaging=" ...

  2. script中的if

    function isOK() { var isTrue = false; var value = $("#myTest1").val(); // if (value && ...

  3. JAVA基础知识之Map集合

    Map的内部结构Entry Set与Map的关系 Map的内部类Entry Map的通用方法及Map的简单用法 HashMap和HashTable的区别 HashMap和HashTable判断元素相等 ...

  4. css3 转换transfrom 过渡transition 和两个@

    做了一个demo.用到一些css3的动画,还是不太熟练,总结了一下.  1. -webkit-font-smoothing: antialiased;       -webkit-font-smoot ...

  5. 2016年11月7日 星期一 --出埃及记 Exodus 19:23

    2016年11月7日 星期一 --出埃及记 Exodus 19:23 Moses said to the LORD, "The people cannot come up Mount Sin ...

  6. 网络编程(一)——InetAddress

    网络编程(一)--InetAddress InetAddress类在java中代表的是IP地址,它有两个子类分别是Inet4Address和Inet6Address,其中Inet4Address代表的 ...

  7. 窗口移动--基类(BaseForm)

    #region 窗口移动 private bool _isLeftButtonDown = false; public const int HTCAPTION = 0x0002; protected ...

  8. BZOJ 2666: [cqoi2012]组装

    题目链接:http://www.lydsy.com:808/JudgeOnline/problem.php?id=2666 题意:n种零件,m个位置,每个位置有一种零件.求一个位置x,使得cost(1 ...

  9. Win7 winsock 注册表文件

    http://files.cnblogs.com/xsmhero/Winsock_Win7x64.rar

  10. Linux 新手非常有用的命令

    http://www.cnblogs.com/felix-/p/4341773.html Linux 新手非常有用的命令 你打算从Windows换到Linux上来,还是你刚好换到Linux上来?哎哟! ...