android 透明度
16lz
2021-01-23
引用:http://www.2cto.com/kf/201109/102376.html
设置透明效果 大概有三种
1、用android系统的透明效果
Java代码
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" />
2、用ARGB来控制
Java代码
半透明<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透明度值
更多相关文章
- 从零开始--系统深入学习android(实践-让我们开始写代码-Android框
- android代码实现背景切换
- android切换效果、Flutter信息类App、仿饿了么点餐、仿爱壁纸应
- Android设置android:clipChildren达到的特殊UI设计效果
- [置顶] Android 各类功能效果源代码集合
- android中使用afinal一行代码显示网络图片
- 笔记 android 代码中设置Android:layout_gravity
- 代码中设置drawableright
- android 设置透明效果