创建黑莓透明Mainscreen [英] Create Transparent Mainscreen in Blackberry

查看:288
本文介绍了创建黑莓透明Mainscreen的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建我的黑莓应用类型 MainScreen 这应该是 Transparen /半透明
我用下面的code试图在 MyCustomMainScreen的构造函数,但它仍然显示一个白色的屏幕

i want to create a type of MainScreen in my Blackberry app which should be Transparen/Translucent. I tried with following code on MyCustomMainScreen's constructor but it still shows a white screen

Background bg = BackgroundFactory.createSolidTransparentBackground(Color.BLACK, 50);
this.setBackground(bg);

我已经阅读了论坛,也测试了它弹出屏幕和它正常工作与他们,但失败 mainscreens
没有人有任何想法如何实现这一目标的MainScreen ..?

I have read in the forum and also tested it for popup screens and it works fine with them but fails with mainscreens. Does anyone have any idea how to achieve this for MainScreen..?

- 大0

推荐答案

重写paint方法,如:

override the paint method like:

class M extends MainScreen
{
        public M() 
        {
            setBackground(BackgroundFactory.createSolidTransparentBackground(Color.ANTIQUEWHITE, 100));
            LabelField l=new LabelField("hello");
            add(l);
        }
        protected void paint(Graphics graphics) 
        {
            super.subpaint(graphics);
        }
  }

这篇关于创建黑莓透明Mainscreen的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆