简体   繁体   English

用秒显示iPhone锁屏(自用)

[英]Show iPhone lock screen with seconds (own usage)

Note : this is not intended to be published by Apple - it's for my own usage 注意 :Apple 打算发布 - 这是我自己的用法


Looking at having seconds shown on the lock screen of my iPhone (iOS 11). 看着我的iPhone(iOS 11)锁屏上显示的秒数。
There doesn't seem to be any setting that reaches that goal. 似乎没有任何设置达到该目标。

So I'm contemplating doing this via a program. 所以我正在考虑通过一个程序来做这件事。

Now: 现在: 在此输入图像描述

Goal: 目标: 在此输入图像描述


edit 编辑

The lock screen is protected, for good reasons, but again the app will not be published. 锁定屏幕受到保护,理由很充分,但应用程序将不再发布。

This answer ( how-to-set-lock-screen-wallpaper-and-ringtone-programmatically-in-iphone ) addresses static data of the lock screen (and is quite old). 这个答案( 如何设置锁定屏幕 - 壁纸 - 和 - 铃声 - 编程 - 在iPhone中 )解决锁定屏幕的静态数据(并且很老)。

Is there a plist , not directly accessible from the UI, where a property could be changed programmaticaly, in order to show seconds? 是否有一个plist ,不能直接从UI访问,其中可以通过programmaticaly更改属性,以显示秒?

Or is there a way to achieve this thanks to an API, change the View behavior to include seconds? 或者有没有办法通过API来实现这一点,将View行为更改为包括秒?

I know this is probably a suggestion you don't want to hear but I think is probably your best option. 我知道这可能是你不想听到的建议,但我认为这可能是你最好的选择。 Jailbreaks are coming out for iOS 11 (right now there is Electra) and will probably be the easiest way. iOS 11即将推出越狱(现在有Electra),可能是最简单的方法。 You'd also encounter the issue of your app not being certified for more than a week unless you have a developer account with Apple. 除非您拥有Apple的开发者帐户,否则您还会遇到一个问题,即您的应用未获得超过一周的认证。 Regardless, I found a decent tutorial by LaughingQuoll (he has made some fairly popular tweaks for Cydia) to get started with Theos. 无论如何,我找到了一个体面的教程,由LaughingQuoll(他为Cydia做了一些相当受欢迎的调整)开始使用Theos。 Once you've got started, you can look into the Theos docs and iPhonedevwiki to see how to modify the lock screen. 一旦开始,您可以查看Theos文档iPhonedevwiki以了解如何修改锁定屏幕。 In my opinion it'd be a lot of work but worth it once you're able to mod your phone how you want ;). 在我看来,一旦你能够按照你想要的方式修改你的手机,这将是很多工作但值得一试;)。

Alternatively, jailbreak and look for an already made tweak. 或者,越狱并寻找已经完成的调整。

Edit: While I don't know where exactly it is, if you're looking to edit a file that's on yor device internally, you can use Filza . 编辑:虽然我不知道它究竟在哪里 ,如果你想在内部编辑你的设备上的文件,你可以使用Filza It's an app available for Jailbroken devices that allows for browsing and modification of your device's files. 这是一个适用于越狱设备的应用程序,允许浏览和修改您设备的文件。 The link provided can be opened in the Cydia app if you have it installed and just incase it doesn't work the repo it's in is BigBoss (a default repo). 提供的链接可以在Cydia应用程序中打开,如果你安装了它,只是因为它不起作用它的存储是BigBoss(一个默认的回购)。 The best I could find is modifying the lock screen "Touch ID to Unlock" text. 我能找到的最好的是修改锁定屏幕“Touch ID to Unlock”文本。 You can find this in /System/Library/CoreServices/Springboard.app/en.lproj/SpringBoard.strings , although I think anywhere in /System/Library/CoreServices/Springboard.app/ could have what you want hidden away. 你可以在/System/Library/CoreServices/Springboard.app/en.lproj/SpringBoard.strings找到它,虽然我认为/System/Library/CoreServices/Springboard.app/任何地方/System/Library/CoreServices/Springboard.app/可以隐藏你想要的东西。 Maybe not, I'm unsure. 也许不是,我不确定。 Let me know where abouts it is if you find what you need. 如果你找到了你需要的东西,让我知道它在哪里。 Good luck. 祝好运。

I can think of a "cheater method" that would be much easier than coding but could solve your issue depending on the purpose . 我可以想到一个比编码更容易的“骗子方法”,但可以根据目的解决你的问题。 (If your "end goal" is to be able to "time things" without unlocking your phone this could suffice.) (如果你的“最终目标”是能够在没有解锁手机的情况下“计时”,这就足够了。)

You could create an Animated GIF for your lock screen image, showing the seconds counting (or optionally higher resolution like tenths of a second) in digital, analog or whatever other format you wanted. 您可以为锁定屏幕图像创建一个动画GIF,以数字,模拟或其他任何您想要的格式显示秒数(或可选的更高分辨率,如十分之一秒)。

  • With a jailbroken iPhone you can use an app like GifLock to use an Animated GIF for your lock screen image. 使用越狱的 iPhone,你可以使用像GifLock这样的应用程序为你的锁屏图像使用动画GIF。 ( Source ) 来源

  • With a non-jailbroken iPhone I think you can use an app like Giphy to convert an Animated GIF into a Live Photo which can be set as a lock screen image. 使用非越狱 iPhone我认为你可以使用像Giphy这样的应用程序将动画GIF转换为可以设置为锁定屏幕图像的实时照片。 ( Source ) 来源

As for creating the Animated GIF to your liking, I use ScreenToGIF for all my GIF-animating needs. 至于根据自己的喜好创建动画GIF,我使用ScreenToGIF来满足我所有的GIF动画需求。 It's meant for PC screen recording, so this wouldn't be within it's "intended purpose", but outside of that there are numerous tools for building Animated GIF's. 适用于PC屏幕录制,因此不在其“预期目的”范围内,但除此之外,还有许多用于构建动画GIF的工具。


sample gif I slapped this together in 2 minutes for testing at my cell's resolution. 我在2分钟内把它打成一团,按照我的手机分辨率进行测试。
(Obviously you would need to include more than 4 frames.) (显然你需要包含超过4帧。)


Image from one of the links: (It made me LOL so I had to include it) 来自其中一个链接的图片:(它让我大声笑,所以我不得不包括它) weird dancing guy


...and just since we're on the topic of Clocks & GIF's , here's one I just added to my SO profile page, for no constructive purpose whatsoever: ......就在我们关于Clocks和GIF的话题时,我刚刚添加到我的SO个人资料页面中, 没有任何建设性的目的: clock
(Click the image to view a mesmerizing 'large version' while you ponder your lock screen options.) (当您考虑锁屏选项时,单击图像查看令人着迷的“大版本”。)


PS - I realize this isn't solution isn't following the criteria set in the question and therefore I don't expect the bounty . PS - 我意识到这不是解决方案不符合问题中设定的标准,因此我不指望赏金 Honestly I didn't even realize there was a bounty until just now, I'm just trying to think out-of-box for alternative solutions. 老实说,我甚至没有意识到一个赏金直到刚才,我只是试图想出来的现成的替代解决方案。

Make a Today extension (aka Widget). 制作今天的扩展(也称为Widget)。 The biggest downside is that you'll need to swipe right in order to see it. 最大的缺点是你需要向右滑动才能看到它。 I've made the complete code available here . 我在这里提供了完整的代码。 I don't think posting the code in this answer brings a lot of value because it is ultimately very trivial. 我不认为在这个答案中发布代码会带来很多价值,因为它最终是非常微不足道的。 It's just a timer that updates a label (aka a clock). 它只是一个更新标签(又称时钟)的计时器。

Today extensions let you run a tiny app on the lock screen. 今天扩展允许您在锁定屏幕上运行一个小应用程序。 So you can show a clock, and while it is visible you can update the view live. 所以你可以显示一个时钟,当它可见时你可以实时更新视图。 (Whenever the view is not completely visible, the system shows the last snapshot.) But, the page with the widgets is "to the left" of the notifications/clock page so you have to swipe right if you want to see it widget. (每当视图不完全可见时,系统会显示最后一个快照。)但是,带有小部件的页面位于通知/时钟页面的“左侧”,因此如果要查看小部件,则必须向右滑动。 So long as you can go the extra distance of waking up the screen and then swiping right, this solution may work for you. 只要您可以更长时间地唤醒屏幕然后向右滑动,此解决方案可能适合您。

The gif doesn't capture the sub-second updating very well, but it looks nice on my phone. gif没有很好地捕获亚秒级更新,但它在我的手机上看起来不错。 If I ever have the need to see the time like this, I'll be glad to have solved the problem already. 如果我有必要看到这样的时间,我会很高兴已经解决了这个问题。

在此输入图像描述

Notes: * It seems like on Xcode 9.3 you'll need to run the project 2 times to get it to show up. 注意: *似乎在Xcode 9.3上,您需要运行该项目2次才能显示它。 I read that in the release notes a dozen times but never knew what it meant until now. 我在发行说明中读了十几次,但直到现在才知道它的含义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM