android中ImageView、ImageButton、Button之间的区别
来源:互联网 发布:外贸erp软件 编辑:程序博客网 时间:2024/05/16 18:47
1.继承不同:
java.lang.Object -> android.view.View -> android.widget.ImageView -> android.widget.ImageButton
java.lang.Object -> android.view.View -> android.widget.TextView -> android.widget.Button
因而ImageButton 不支持setText,而Button支持。反之,ImageButton 支持setImageURI,而Button不支持。Button和ImageButton有Button的状态,但是ImageView没有。
2.显示差异:
imageView 加上可点击的属性同样实现button的点击功能,这样看来没啥区别,可是可是,最近我做的listView,一个imagebutton,一个imageView 显示圆角图片的时候,imageBotton 居然显示不出来.
ImageButton 拥有默认背景:
<style name="Widget.ImageButton"> <item name="android:focusable">true</item> <item name="android:clickable">true</item> <item name="android:scaleType">center</item> <item name="android:background">@android:drawable/btn_default</item> </style>
去除ImageButton默认背景的方法:
<!-- layout_width和layout_height属性必须是wrap_content,否则边框还是会显示 --><ImageButton android:id="@+id/ibLogin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/btn_login" android:adjustViewBounds="true" android:padding="0dp"/>
引文:
http://blog.csdn.net/zapzqc/article/details/8497210
http://www.androidlearner.net/android-delete-whiteframe-imagebutton.html
- android中ImageView、ImageButton、Button之间的区别
- android中ImageView、ImageButton、Button之间的区别
- Android中Button,ImageButton,ImageView之间的区别
- android中ImageView、ImageButton、Button之间的区别
- Android中ImageView、ImageButton、Button之间的区别
- android中ImageView、ImageButton、Button之间的区别
- android中ImageView、ImageButton、Button之间的区别
- android:ImageView 和ImageButton的区别
- android Button ImageButton 区别
- android Button ImageButton 区别
- android Button ImageButton 区别
- Android ImageButton和Button的区别
- android ImageButton 和Button的图标区别
- android ImageButton和Button区别
- ImageView和ImageButton的区别
- ImageButton与ImageView的区别
- Android中ImageView和ImageButton
- FAQ_15_android Imageview ImageButton Button
- 如何查看 Common Lisp 的标准函数
- JavaScript 图片滚动(绝对酷)
- HappyIdio界面的实现
- java 反编译工具 jad
- 解决HttpServletResponse输出的中文乱码问题
- android中ImageView、ImageButton、Button之间的区别
- 杨澜给女孩的忠告
- 十六周项目1 文件的应用
- 使用php来读取纯真ip数据库
- LINUX 硬链接与软链接的区别
- 在Ubuntu Server 12.04 x64下安装Graphite
- IE8开发人员工具消失(透明、打不开)的完全解决方案
- 连续奇数和
- mac os x 10.7 环境变量备份