java - 使用 alpha 属性设置 View alpha 或为背景属性添加合适的值是否重要?
问题描述
出于某种原因,我无法理解何时要将不透明度设置为 0.6 到某个视图,所以当我设置以下代码时:
<View
android:id="@+id/bottom_divider"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:background="#9903a9f4"/>
和以下代码:
android:id="@+id/bottom_divider"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:background="#9903a9f4"
android:alpha="0.6"/>
我得到了不同的颜色,** althugh** 99在六进制背景的开头等于 255 倍数在 0.6 有人可以解释我为什么我在两个代码中得到不同的颜色吗?
解决方案
推荐阅读
- capl - 如何使用 CAPL 在 CANoe 中模拟错误帧并使错误计数器增加/减少?
- c# - FreshPageModelResolver.ResolvePageModel<>() 出错;
- excel - excel中的数据库vlookup有什么问题
- c# - 使用公式将项目添加到数组的更快方法
- php - FCM 成功但 android 设备未收到通知
- python - 使用python在csv文件中连续查找10个最大数字?
- amazon-web-services - AWS:如何使用 A 记录将非 Route53 域映射到 CloudFront
- docker - 无法将 docker.sock 绑定到 Docker 服务
- python - 如何从数据库 Django 3.0 中获取图像
- ios - 在 iOS WKWebview 的 iFrame 中阻止第三方 cookie