问题
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