Search code examples
iosiphonexcodestatusbaruistatusbar

Custom background color for status bar in iOS app created with Xcode and Swift


I already googled a little bit but without success. I want to have a custom background color for the status bar in all my ViewControllers (only in portrait mode). The ViewControllers are managed with a TabBarController.

Does anybody know how to do that? Maybe anybody has a code sample?


Solution

  • I already solved the problem myself by putting a UIView below the Status bar and set the background color. But I had to clear all constraints and add them again to make the UIView hiding in landscape mode.