Android控件之Button(按钮控件)和ImageButton(图片按钮控件)
一、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(图片按钮控件)的更多相关文章
- Android实现图片滚动控件,含页签功能,让你的应用像淘宝一样炫起来
首先题外话,今天早上起床的时候,手滑一下把我的手机甩了出去,结果陪伴我两年半的摩托罗拉里程碑一代就这么安息了,于是我今天决定怒更一记,纪念我死去的爱机. 如果你是网购达人,你的手机上一定少不了淘宝客户 ...
- [CSS]Input标签与图片按钮对齐
页面直接摆放一个input文本框与ImageButton图片按钮,但是发现没有对齐: <input type="text" id="txtQty" /&g ...
- 【读书笔记《Android游戏编程之从零开始》】3.Android 游戏开发常用的系统控件(Button、Layout、ImageButton)
3.1 Button Button这控件不用多说,就是一个按钮,主要是点击后进行相应事件的响应. 给组件添加ID属性:定义格式为 android:id="@+id/name",这里 ...
- 【Android开发日记】之入门篇(十四)——Button控件+自定义Button控件
好久不见,又是一个新的学期开始了,为什么我感觉好惆怅啊!这一周也发生了不少事情,节假日放了三天的假(好久没有这么悠闲过了),实习公司那边被组长半强制性的要求去解决一个后台登陆的问题,结果就是把 ...
- android基本控件学习-----Button
Button讲解: 一.在我们实际的使用button的时候经常会对button不同状态会有不同的显示,在讲解Button前,首先对drawable下面的statelistdrawable的相关知识讲一 ...
- 【Android】10.0 UI开发——如何编写程序界面、常见控件的使用
************************ 转载请注明出处:https://www.cnblogs.com/xiaofu007/p/10331880.html ***************** ...
- ASP.NET控件<ASP:Button /> html控件<input type="button">区别联系
ASP.NET控件<ASP:Button />-------html控件<input type="button">杨中科是这么说的:asp和input是一样 ...
- Android 使用代码主动去调用控件的点击事件(模拟人手去触摸控件)
使用代码主动去调用控件的点击事件(模拟人手去触摸控件) //View 可以是LinearLayout,Button,TextView View.performClick();
- winform中button点击后再点击其他控件致使button失去焦点,此时button出现黑色边线,去掉黑色边线的方法
winform中button点击后再点击其他控件致使button失去焦点,此时button出现黑色边线,去掉黑色边线的方法 button的FlatAppearence属性下,设置BorderSize= ...
随机推荐
- C# 加密解密
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Secur ...
- Curling 2.0 分类: 搜索 2015-08-09 11:14 3人阅读 评论(0) 收藏
Curling 2.0 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14289 Accepted: 5962 Descript ...
- 将本地项目上传到Github
将本地项目上传到Github 转载请注明出自天外归云的博客. 前提 已经下载了Git到本地. 创建Repository 首先登陆我的Github页面,在Repositories中New一个并起Repo ...
- 学习java annotation
Annotation介绍 内置注解 自定义注解 元注解 /** * 测试自定义注解的使用 * */ @SxtAnnotation01 public class Demo02 { @Annotation ...
- UML中的用例(Use Case)概念分析及StarUML实例
在UML中use case似 乎最簡單的,用例建模的最主要功能就是用来表达系统的功能性需求或行为,依我的理解用例建模可分为用例图和用例描述.用例图由参与者(Actor).用例 (Use Case).系 ...
- css3 resize box-sizing outline-offset
resize:设置用户可以自己调整大小 box-sizing: box-sizing属性可以为三个值之一:content-box(default),border-box,padding-box. co ...
- java反编译工具JD-GUI
这款java反编译工具是由C++写的,是一款免费的非商业用途的软件,(Xjad也不错,但是不支持jar反编译) 一.支持众多.class反编译工具 二.支持反编译jar
- 【JSON】Jackson初学,及常用的例子
现在很多公司的项目都基于SOA架构,系统间的调用有许多方式,其中一种常见的是用HTTP协议.以JSON格式返回结果. 这使得JSON的使用更加普遍.而市面上处理JSON的框架五花八门,常见的有JSON ...
- Gearman任务分布系统部署windows平台_使用Cygwin
1.下载Cygwin http://www.cygwin.com/ 然后选择 Install from Internet -> Direct Connection -> 选择第一个网址就 ...
- BZOJ 2658 小蓝的好友
题目链接:http://www.lydsy.com:808/JudgeOnline/problem.php?id=2658 题意:给出一个n*m的格子.某些格子中有障碍.求包含至少一个障碍的矩形有多少 ...