2

我想将壁纸设置为固定且可滚动。这是 OGQ 背景高清应用程序的链接。 https://play.google.com/store/apps/details?id=com.ogqcorp.bgh

该应用程序屏幕截图附在此处,就像我想做的任何事情一样。请建议任何库或反射类代码、黑客或任何其他代码。可滚动的标准壁纸

固定适合屏幕壁纸

固定健身中心壁纸

4

1 回答 1

0

Have you fixed the problem yet? If not, try using the WallpaperManager class.

  • Simply call method setWallpaperOffsetSteps, this method would enable you to edit the offset of the wallpaper based on your existing windows tabs in your android phone.

example(this should be put under your onCreate() in your activity class)

//For fixed wallpaper
      int x,y;
        x = 0; //this is the offset X axis delta from one windows tab to another
        y = 0; // same for Y axis
        WallpaperManager wmng = (WallpaperManager) this.getSystemService(this.WALLPAPER_SERVICE);
        wmng.setWallpaperOffsetSteps(x,y);

//For scrollable
        x = 1; 
        y = 1; 
        wmng.setWallpaperOffsetSteps(x,y);

and remember to put <uses-permission android:name="android.permission.SET_WALLPAPER" /> in your android Manifest

reference:https://developer.android.com/reference/android/app/WallpaperManager#setWallpaperOffsetSteps(float,%20float)

于 2018-07-20T20:41:53.307 回答