避免壁纸横跨 5 个屏幕
我一直面临一个问题。如何在 Android 中设置壁纸,而不将其拉伸到 5 个主屏幕。需要明确的是,我有一个分辨率为 320x480px 的资源图像,当我在 Android 中将其设置为壁纸时,它会拉伸到 5 个屏幕,但我希望它仅显示在 1 个屏幕中(或在所有屏幕中显示相同的图像),知道了?
我对使用动态壁纸不感兴趣。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
让应用程序执行此操作的唯一方法是使用动态壁纸。
壁纸有两种类型:静态壁纸和动态壁纸。静态背景的滚动由启动器应用程序控制。这就是LauncherPro和ADW可以控制滚动的原因。当用户选择动态壁纸时,启动器只需显示 LWP 想要渲染的任何内容,因此 LWP 控制滚动(如果有)。这就是 MultiPicture LWP 解决问题的方式。
因此,您唯一的选择是实现自定义启动器(我怀疑您想要为这样的次要功能执行此操作)或实现动态壁纸。
顺便说一句,
setWallpaperOffsetSteps
是启动器在动态壁纸上调用的内部方法,因此 LWP 知道它应该在哪里绘制。您无法直接调用它,但可以在 LWP 中监听onOffsetsChanged
以方便您自己的滚动实现。Only way to have an app do that is using a live wallpaper.
There are two types of wallpaper, static and live. The scrolling of a static background is controlled by the launcher app. This is why LauncherPro and ADW can control the scrolling. When the user chooses a live wallpaper, the launcher simply displays whatever the LWP wants to render, so the LWP controls the scrolling, if any. This is how MultiPicture LWP solves the problem.
So your only options are to implement a custom launcher (which I doubt you want to do for such minor functionality) or implement a live wallpaper.
And BTW,
setWallpaperOffsetSteps
is an internal method called by the launcher on a live wallpaper, so the LWP knows where it's supposed to be drawing. You can't call it directly, but you can listen toonOffsetsChanged
within your LWP to facilitate your own scrolling implementation.当您弹出“添加到主屏幕”时,点击并按住您的屏幕
选择“壁纸”
选择“主屏幕壁纸”
当您从图库或资源管理器中选择图片时,您将看到一个屏幕,您可以在其中裁剪图像以适合主屏幕。
在底部您可以选择 2 种作物。
大裁剪用于在 5 个屏幕上设置它,小裁剪用于在所有 5 个屏幕上使用相同的 BG。
请参阅屏幕截图:
选择后者,裁剪图片并保存。
Tap and hold your screen when you get popup "add to home screen"
select "wallpapers"
select "home screen wallpaper"
when you've selected a picture from gallery or explorer you get a screen where you can crop your Image to fit home screen.
On the bottom you can select 2 type of crops.
A big crop for setting it accros 5 screens and a small crop to use the same BG on all 5 screens.
see screenshot:
select the latter, crop your picture and save.
不可能。可能有任何私人图书馆。
Not possible. May be there are any private libraries for it.
显然这不是 Android 原生功能。但是,您可以获得执行此操作的应用程序。 “Launcher Pro”和“ADW EX Launcher”都可以禁用滚动,但您可能需要创建一个具有正确尺寸的空边框的横向矩形图像。
或者,“多图片动态壁纸”应用程序可以满足您的需求。一位评论者写道:“让我使用与手机屏幕大小相同的图片作为启动器所有页面的背景。不知道为什么这不是 Android 的一部分。”
编辑:在尝试这些之前先看看 tdtje 的帖子。如果这有效的话,那就太棒了。我不确定哪个版本的 Android 可用,因为我使用的是没有该功能的 2.1。
进一步编辑:在下面的评论中,Martyn 为我们提供了第一手意见!
Apparently it's not native Android functionality. You can, however, get apps that do it. "Launcher Pro" and "ADW EX Launcher" can both disable scrolling but you may need to create a landscape rectangular image with empty borders at the right size.
Alternatively, the app "MultiPicture Live Wallpaper" may do what you need. A reviewer wrote: "Lets me use a picture sized the same as my phone's screen as the background on all pages of the launcher. Not sure why that isn't part of Android."
EDIT: have a look at tdtje's post before you try these. If that works, then awesome. I'm not sure which version of Android that became available in, as I'm using 2.1 without that feature.
FURTHER EDIT: In the comments below, Martyn gives us a first hand opinion!
我进入“设置”并单击“主屏幕”。然后去壁纸。我选择了我的照片并使用图库应用程序进行了裁剪。顶部有一个设置可以拉伸或不拉伸。我运行的是安卓4.4。
I went to Settings and clicked on home screen. Then went to wallpaper. I selected my picture and cropped using the gallary app. This had a setting on the top to either stretch or not. I'm running Android 4.4.