假定此代码#272727a6是深色的几乎是黑色的,透明度为30%,但在android中似乎是蓝色,而在CSS代码或网络中,如果它是透明的黑色,我该怎么办错误?还是在Android中,十六进制代码的工作方式有所不同?
Android.Hardware.Camera camara;
ISurfaceHolder camaraHolder;
SurfaceView camaraPre;
RelativeLayout contenedorBtnCaptura;
ImageButton btnCamara;
ProgressDialog progressDialog;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.Camara);
contenedorBtnCaptura = FindViewById<RelativeLayout>(Resource.Id.contenedorBtnCaptura);
contenedorBtnCaptura.SetBackgroundColor(Color.ParseColor("#272727a6"));
btnCamara = FindViewById<ImageButton>(Resource.Id.btnCamara);
btnCamara.SetImageResource(Resource.Mipmap.btnCapturar);
btnCamara.SetOnTouchListener(this);
btnCamara.Click += delegate
{
ProcesarCaptura();
};
camaraPre = FindViewById<SurfaceView>(Resource.Id.surfaceCamara);
camaraHolder = camaraPre.Holder;
camaraHolder.AddCallback(this);
camaraHolder.SetType(SurfaceType.PushBuffers);
}
答案 0 :(得分:0)
黑色->#000000
如果要透明度,请在#后面添加2个字符:
完全透明->#(00)000000 = #00000000
完全不透明->#(ff)000000 = #ff000000
因此,#后面的8个字符(透明度2个+颜色6个)
00到ff之间,您有256种不同的透明度:)