我想将壁纸设置为固定且可滚动。这是 OGQ 背景高清应用程序的链接。 https://play.google.com/store/apps/details?id=com.ogqcorp.bgh
问问题
1733 次
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
于 2018-07-20T20:41:53.307 回答