Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Blackberry 黑莓背景图片?_Blackberry_Background - Fatal编程技术网

Blackberry 黑莓背景图片?

Blackberry 黑莓背景图片?,blackberry,background,Blackberry,Background,我搜索过,但没有找到任何解决方案,我有,但它创造了问题。当我插入这个时,它表示非法参数,并且不会开始 Bitmap bitmap = Bitmap.getBitmapResource("Background.png"); this.getMainManager().setBackground( BackgroundFactory.createBitmapBackground(bitmap) ); 它不起作用 谢谢你的帮助!它起作用了。只是我的路

我搜索过,但没有找到任何解决方案,我有,但它创造了问题。当我插入这个时,它表示非法参数,并且不会开始

Bitmap bitmap = Bitmap.getBitmapResource("Background.png");

 this.getMainManager().setBackground(

             BackgroundFactory.createBitmapBackground(bitmap)
         );
它不起作用

谢谢你的帮助!它起作用了。只是我的路径有个打字错误

final Bitmap top = Bitmap.getBitmapResource("your background image.png");
final VerticalFieldManager top_ = new VerticalFieldManager(Manager.NO_HORIZONTAL_SCROLL | Manager.NO_HORIZONTAL_SCROLLBAR | Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR | Field.USE_ALL_WIDTH){

        public void paint(Graphics graphics) {
            graphics.drawBitmap(0, 0, top.getWidth(),
                    top.getHeight(), top, 0, 0);
            super.paint(graphics);
        }

    };

现在,将所有字段添加到此顶部。然后将顶部添加到屏幕上。如果没有字段,则不会显示背景图像。因此,别忘了添加一些字段。

您想将字段添加到此图像中吗?不,我只想设置一个背景我的意思是,是的,在该背景前面将有标签和一些字段。我现在有许多具有不同布局的字段。难道不能用另一种方法吗?因为我使用2或3个垂直和水平管理器:S和我已经上了16节课了。我想在结尾加上背景。现在知道如何解决这个问题了吗?将所有项目添加到此VerticalFieldManager。然后将其添加到屏幕。是的,它可以工作,但已填充了一半。如何将其设置为100%宽度和100%高度?使用Field.use_ALL_width和Field.use_ALL_height或设置边距。