android:background="#88CCCCCC" 8位颜色值 是什么意思?

我们在Android开发时常用的颜色值为6位或3位如:

android:background="#CCCCCC"android:background="#CCC"

那如果颜色值是8位的是表示什么意思,会是什么效果呢?如下:

android:background="#88CCCCCC"

三位和六位的是rgb色值rrggbb,而八位的值表示argb色值(aarrggbb),a就是alpha所以88CCCCCC这个前面两位88表示透明度

后面的CCCCCC表示了颜色值。


<!-- 在原有布局基础上添加校准面板 --> <LinearLayout android:id="@+id/calibrationPanel" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="#80000000" android:padding="16dp" android:visibility="gone" app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="颜色校准" android:textSize="20sp" android:textColor="@android:color/white" android:textStyle="bold"/> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginTop="8dp"> <Button android:id="@+id/btnCaptureWhite" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="白色校准" android:backgroundTint="#9E9E9E"/> <Button android:id="@+id/btnCaptureBlack" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="黑色校准" android:backgroundTint="#212121" android:layout_marginStart="8dp"/> </LinearLayout> <Button android:id="@+id/btnCaptureCustom" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="自定义校准" android:layout_marginTop="8dp"/> <Button android:id="@+id/btnResetCalibration" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="重置校准" android:backgroundTint="#F44336" android:textColor="@android:color/white" android:layout_marginTop="8dp"/> <TextView android:id="@+id/tvCalibrationStatus" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="校准状态: 未校准" android:textSize="14sp" android:textColor="#CCCCCC" android:layout_marginTop="8dp"/> </LinearLayout> 此布局是之前回复的答案,但是没看到btnCalibrationToggle这个控件id,,
最新发布
07-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值