IOS Text below Status Bar while app is in Background

♀尐吖头ヾ 提交于 2020-02-16 05:40:11

问题


I'm trying to figure out how to implement a banner like notification with text below the statusbar while an app is in the background.

Much like Runkeeper, while active and app is in background:

Is it a Banner? All I can find for that is banners for ads while the app is in the foreground.

Do I need to customize the StatusBar and add an extra view for the StatusBar with a custom text to appear?

Is it a customized UILocalNotification to be continuously shown?


回答1:


This banner is displayed by iOS itself in the following situations:

  • A background app is tracking your position (after a startUpdatingLocation)
  • A background app is using your microphone
  • A background app is performing a VOIP call

The banner color changes with the reason.
There is no way to force iOS to display those banners but by using one of the relevant background modes.



来源:https://stackoverflow.com/questions/32630267/ios-text-below-status-bar-while-app-is-in-background

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!