Android ImageView 图片设置为透明
方法一:
在xml中,设置如下
<ImageView android:id="@+id/xx_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/xx" /> <ImageView android:id="@+id/xx_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/xx" />java代码中
private ImageView image; image = (ImageView) findViewById(R.id.xx_id); image.getBackground().setAlpha(0);方法二:
在xml中,设置如下
<ImageView android:id="@+id/xx_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/xx" /> <ImageView android:id="@+id/xx_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/xx" />java代码中
private ImageView image; image = (ImageView) findViewById(R.id.xx_id); image.setAlpha(0);Android ImageView 图片设置为透明的更多相关文章
- Android webview背景设置为透明无效 拖动时背景闪烁黑色
Adndroid 2.X的设置 webview是一个使用方便.功能强大的控件,但由于webview的背景颜色默认是白色,在一些场合下会显得很突兀(比如背景是黑色). 此时就想到了要把webview的背 ...
- Android ImageView图片透明区域不响应点击事件,不规则图片透明区域响应点击事件
转载:http://blog.csdn.net/aminfo/article/details/7872681 经常会在项目中用到透明图片,不规则图片,特别是做游戏的时候,需要对图片的透明区域的点击事件 ...
- Android ImageView图片自适应 (转)
网络上下载下来的图片自适应:android:adjustViewBounds="true"(其详细解释在下面)<ImageView android:id=" ...
- [Android] ImageView.ScaleType设置图解 【转载】
ImageView的Scaletype决定了图片在View上显示时的样子,如进行何种比例的缩放,及显示图片的整体还是部分,等等. 设置的方式包括: 1. 在layout xml中定义android:s ...
- [Android] ImageView.ScaleType设置图解
ImageView的Scaletype决定了图片在View上显示时的样子,如进行何种比例的缩放,及显示图片的整体还是部分,等等. 设置的方式包括: 1. 在layout xml中定义android ...
- Android ImageView图片自适应
网络上下载下来的图片自适应:android:adjustViewBounds="true"(其详细解释在下面) <ImageView android:id=" ...
- Android Imageview 图片居左居右,自定义圆角
android:scaleType="fitStart" 图片靠左不变形显示, android:scaleType=”fitEnd” 图片靠右显示,不变形. 半透明andr ...
- Xamarin.Android ImageView 图片圆角显示
第一步:在 values 文件夹下新增 Attrs.xml 文件 <?xml version="1.0" encoding="utf-8" ?> & ...
- xamarin.Android ImageView 图片圆角(自定义属性、扩展控件)
新增 /values/Attrs.xml 文件 <?xml version="1.0" encoding="utf-8" ?> <resour ...
随机推荐
- TCP/UDP基本概念部分
最近在读<Unix网络编程>和<TCP/IP详解>两本书,有了一些自己的心得与体会,总结下其中典型的问题. 1. 为什么建立连接需要三次握手? 谢希仁的<计算机网络> ...
- Android 学习手札(二) 活动(Activity)组件
1.建立和配置Activity 建立Android工程时已经自动生成了一个默认的Activity,同时也生成了很多与Activity相关的文件,例如,res目录中的XML及图像文件.AndroidMa ...
- A*算法深入
A*算法思想容易理解,但要想设计出好的A*算法,则必需要全面深入了解它.在本文章中接下来的内容中,将全面深入探讨该话题.如果对该算法还没有理解的话,则请先查阅上篇文章<A*算法入门>,然后 ...
- List<String^>^ 引用空间
莫名其妙报错 需要在.h和.cpp文件中都引用: using namespace System::Collections;using namespace System::Collections::Ge ...
- google zxing 二维码扫描(android client分析)
一.总体架构 二.架构分析 1. com.google.zxing.client.android AmbientLightManager 环境光线管理 Detects ambient light an ...
- 关于set或map的key使用自定义类型的问题
我们都知道set或map的key使用自定义类型时必须重载<关系运算符 但是,还有一个条件,所调用重载的小于操作符,使用的对象必须是const 而对象调用的方法也必须是const的 1 #incl ...
- 转:PHP超时处理全面总结
原文来自于:http://wulijun.github.io/2012/08/08/php-timeout-summary.html 概述 在PHP开发工作里非常多使用到超时处理的场合,我说几个场景: ...
- ios入门之c语言篇——基本函数——1——随机数生成
1.随机数函数 参数返回值解析: 参数: a:int,数字范围最小值: b:int,数字范围最大值: 返回值: 1:闰年: 0:非闰年: 备注: a-b的绝对值不能超过int的最大值(65535); ...
- Zabbix的集中式监控
相对于传统的ZABBIX硬件系统级监控(CPU,内存,硬盘,网卡),应用级的监控就显得有些复杂了. 如果对不同的应该来不同的应用,配置会很多的. 如果我们能在一个指定的AGENT上监控所有的APACH ...
- [原创]leet code - path sum
; ; ; } } ; }};