SHARE
TWEET

Untitled

a guest Aug 21st, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Class AppDelegateの最初のfunc applicationの中に記載
  2.  
  3. <pre>
  4. let statusBarBackgroundView = UIView()
  5. statusBarBackgroundView.backgroundColor = UIColor(red: 0/255, green: 0/255, blue: 0/255, alpha: 1)
  6. statusBarBackgroundView.translatesAutoresizingMaskIntoConstraints = false
  7.        
  8. window?.addSubview(statusBarBackgroundView)
  9.        
  10. statusBarBackgroundView.widthAnchor.constraint(equalToConstant: UIApplication.shared.statusBarFrame.width).isActive = true
  11. statusBarBackgroundView.heightAnchor.constraint(equalToConstant: UIApplication.shared.statusBarFrame.height).isActive = true
  12. statusBarBackgroundView.topAnchor.constraint(equalTo: (window?.topAnchor)!, constant: 0).isActive = true
  13. statusBarBackgroundView.leadingAnchor.constraint(equalTo: (window?.leadingAnchor)!, constant: 0).isActive = true
  14. </pre>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top