简体   繁体   English

如何为VerticalFieldManager和/或Horizo​​ntalFieldManager设置背景透明度和颜色?

[英]How to set background transparency and color to VerticalFieldManager and/or HorizontalFieldManager?

The following code isn't working, I would appreciate some help. 以下代码无法正常工作,请提供一些帮助。

HorizontalFieldManager hfm = new HorizontalFieldManager();
hfm.setBackground(BackgroundFactory.createSolidTransparentBackground(Color.BLACK, 0));

You are using 0 as alpha value on createSolidTransparentBackground(int color, int alpha) . 您正在使用0作为createSolidTransparentBackground(int color, int alpha)上的alpha值。

It will create a fully transparent background (not visible). 它将创建完全透明的背景(不可见)。 Check the range of the alpha value in documentation. 检查文档中alpha值的范围。

It says , alpha - 0 (clear) to 255 (opaque) . 它说alpha-0(透明)到255(不透明) Try other values for alpha, eg 127 . 尝试其他Alpha值,例如127

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM