【问题标题】:Stop background from resizing itself阻止背景自行调整大小
【发布时间】:2014-07-24 12:38:19
【问题描述】:

所以在我的应用程序中,我使用系统壁纸作为背景。 我正在使用以下代码 -

  WallpaperManager wallpaperManager = WallpaperManager.getInstance(getActivity());
  Drawable wallpaperDrawable = wallpaperManager.getDrawable();
  view.setBackground(wallpaperDrawable);

问题是,背景正试图向内挤压。换句话说,系统图像试图将整个图像放在一个位上,它看起来很奇怪。如何阻止背景自行调整大小?

更多信息,在我的主屏幕上,壁纸是汽车的图片,你只能看到汽车的前部。但是当你打开我的应用程序时,你可以看到整辆汽车,但它被压扁并调整了大小。

我该怎么做?

【问题讨论】:

    标签: java android class layout resize


    【解决方案1】:

    也许这会有所帮助(来自WallpaperManager Class page):

     wallpaperManager.suggestDesiredDimensions(int minimumWidth, int minimumHeight);
    

    【讨论】:

      猜你喜欢
      • 2019-07-18
      • 1970-01-01
      • 2012-01-14
      • 2021-01-21
      • 1970-01-01
      • 2021-02-05
      • 2012-05-18
      • 2018-12-23
      • 1970-01-01
      相关资源
      最近更新 更多