如何设置黑莓手机的背景

发布于 2025-01-04 03:02:10 字数 670 浏览 3 评论 0原文

我使用以下内容为黑莓设置背景..没有错误,但在输出中 当我向下滚动时,图像会重复..如何解决这个问题。请帮助我

  public final class MyScreen extends MainScreen
    {
      Bitmap background;
    public MyScreen()
    {  

     background = Bitmap.getBitmapResource("CVMS.jpg");
         VerticalFieldManager vfm = new VerticalFieldManager(USE_ALL_HEIGHT | USE_ALL_WIDTH |  
            VerticalFieldManager.NO_VERTICAL_SCROLL);
            vfm.setBackground(BackgroundFactory.createBitmapBackground(Bitmap.getBitmapResource("CVMS.jpg"),Background.POSITION_X_LEFT,Background.POSITION_Y_TOP,Background.REPEAT_INHERIT));  


          add(vfm);

              }
   }
  this is my complete code 

i have used the following to set a background for blackberry ..no errors but in the output
when i scroll down the image gets repeated .. how to solve this problem .please help me

  public final class MyScreen extends MainScreen
    {
      Bitmap background;
    public MyScreen()
    {  

     background = Bitmap.getBitmapResource("CVMS.jpg");
         VerticalFieldManager vfm = new VerticalFieldManager(USE_ALL_HEIGHT | USE_ALL_WIDTH |  
            VerticalFieldManager.NO_VERTICAL_SCROLL);
            vfm.setBackground(BackgroundFactory.createBitmapBackground(Bitmap.getBitmapResource("CVMS.jpg"),Background.POSITION_X_LEFT,Background.POSITION_Y_TOP,Background.REPEAT_INHERIT));  


          add(vfm);

              }
   }
  this is my complete code 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怪我入戏太深 2025-01-11 03:02:10

您需要做的就是更改以下行中的标志

vfm.setBackground(BackgroundFactory.createBitmapBackground(Bitmap.getBitmapResource("CVMS.jpg"),Background.POSITION_X_LEFT, Background.POSITION_Y_TOP, Background.REPEAT_SCALE_TO_FIT));

您只需使用 REPEAT_SCALE_TO_FIT 而不是 REPEAT_INHERIT

All you need to do is change a flag in the following line

vfm.setBackground(BackgroundFactory.createBitmapBackground(Bitmap.getBitmapResource("CVMS.jpg"),Background.POSITION_X_LEFT, Background.POSITION_Y_TOP, Background.REPEAT_SCALE_TO_FIT));

You just need to use REPEAT_SCALE_TO_FIT instead of REPEAT_INHERIT

眸中客 2025-01-11 03:02:10

您是否尝试过使用Background.REPEAT_NONE?

Have you tried using Background.REPEAT_NONE ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文