设置透明效果 大概有三种

1、用android系统的透明效果
Java代码
android:background="@android:color/transparent"
android:background="@android:color/transparent"
例如 设置按钮
Java代码
<Button android:background="@android:color/transparent"

android:text="@+id/Button01"

android:id="@+id/Button01"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:textColor="#ffffff" />
< Button android:background="@android:color/transparent"
android:text="@+id/Button01"
android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff" />
2、用ARGB来控制
Java代码
半透明<Button android:background="#e0000000" />
透明<Button android:background="#00000000" />
半透明<Button android:background="#e0000000" />
透明<Button android:background="#00000000" />

3、设置alpha
Java代码
View v = findViewById(R.id.content);//找到你要设透明背景的layout 的id
v.getBackground().setAlpha(100);//透明度0~255透明度值 ,值越小越透明

更多相关文章

  1. Android文字的阴影效果
  2. 短视频源码,实现文字横向移动效果(跑马灯效果)
  3. android - TextView单行显示...或者文字左右滚动(走马灯效果)
  4. 多点触控测试代码 PointerLocation
  5. Android帧布局-实现渐变效果
  6. Android静态代码分析
  7. android添加动画效果
  8. android textview 跑马灯 滚动效果
  9. 【Android】附加Android源代码Androidandroid_gingerbread_javas

随机推荐

  1. Android保存图片到本地或者数据库,并通知
  2. Android屏幕截图并保存截取屏幕的图片到
  3. android 页面容器 下一页很上一页view
  4. java判断http请求是否为为手机端来源
  5. Android(安卓)手势识别
  6. Android定时器实现的几种方式
  7. Android(安卓)带清除功能的输入框控件实
  8. android利用handler回到主线程
  9. android switch button 报 java.lang.Nul
  10. Android uses-permission大全