大概有三种

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. Android程序开发中关于设置全屏无效问题
  3. android:EditText属性
  4. Android(安卓)学习笔记(十六):Widget-进度条
  5. Android(安卓)查看源码
  6. Android(安卓)ListView 去除边缘阴影、选中色、拖动背景色等(and
  7. Android(安卓)Map开发基础知识学习笔记
  8. android:screenOrientation属性
  9. Android与JS互调

随机推荐

  1. Android(安卓)anr异常测试
  2. Android(安卓)Material Design 实践(三)-
  3. android webview无网络情况下的处理
  4. Android(安卓)Studio 自带的侧滑布局设置
  5. Android(安卓)switch 开关(兼容)
  6. android Gallery 详解
  7. android:HttpURLConnection
  8. android视频聊天源码下载(wifi)
  9. Android中onSaveInstanceState和onRestor
  10. Android_自定义View拖拽重绘