以编程方式更改 iOS 锁屏

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6243591/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 20:14:04  来源:igfitidea点击:

Programmatically changing the iOS lock-screen

iphoneiossdkwallpaperlockscreen

提问by nextbighit

I'm building an app which would have to have the ability to show my own views on the iPhone lock screen. I've seen lots of apps which let you customize the lockscreen and so forth and these were App Store apps so i'm guessing it has to possible.

我正在构建一个应用程序,它必须能够在 iPhone 锁定屏幕上显示我自己的视图。我见过很多可以让你自定义锁屏等等的应用程序,这些是 App Store 应用程序,所以我猜它必须是可能的。

I just can't figure out what to use in the iOS SDK to even try implementing this.

我只是不知道在 iOS SDK 中使用什么来尝试实现它。

Oh and P.S: same goes for wallpapers—can we change this from inside our app?

哦还有 PS:壁纸也是如此——我们可以从我们的应用程序内部更改它吗?

回答by Norbert

It can be changed programmatically (change to SpringBoard), but it won't make the way to the (official) AppStore. So if you want to build an app that can change something like the lock screen wallpaper or the ring tone which you usually need the Settings app for, you have to publish your application via Cydia, not Apple's store.

它可以通过编程方式更改(更改为 SpringBoard),但不会进入(官方)AppStore。因此,如果您想构建一个可以更改诸如锁屏墙纸或铃声之类的应用程序,您通常需要设置应用程序来更改这些内容,您必须通过 Cydia 发布您的应用程序,而不是通过 Apple 的商店。

For a sample code block, see this answer.

有关示例代码块,请参阅此答案