<!--
{
  "availability" : [
    "iOS: 2.0.0 - 9.0.0",
    "iPadOS: 2.0.0 - 9.0.0",
    "macCatalyst: 13.1.0 - 13.1.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIApplication/setStatusBarStyle(_:animated:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIApplication(im)setStatusBarStyle:animated:"
  },
  "title" : "setStatusBarStyle(_:animated:)"
}
-->

# setStatusBarStyle(_:animated:)

Sets the style of the status bar, optionally animating the transition to the new style.

```
func setStatusBarStyle(_ statusBarStyle: UIStatusBarStyle, animated: Bool)
```

## Parameters

`statusBarStyle`

A constant that specifies a style for the status bar. See the descriptions of the constants in [`UIStatusBarStyle`](/documentation/UIKit/UIStatusBarStyle) for details.

`animated`

<doc://com.apple.documentation/documentation/Swift/true> if the transition to the new style should be animated; otherwise <doc://com.apple.documentation/documentation/Swift/false> .

## Discussion

The animation slides the status bar out toward the top of the interface.

In iOS 7 and later, status bar behavior is determined by view controllers, and so calling this method has no effect by default. When view controller-based status bar appearance is disabled, this method behaves normally. To opt out of the view controller-based status bar appearance behavior, you must add the `UIViewControllerBasedStatusBarAppearance` key with a value of <doc://com.apple.documentation/documentation/Swift/false> to your app’s `Info.plist` file, but doing so is not recommended.

## See Also

[`statusBarStyle`](/documentation/UIKit/UIApplication/statusBarStyle)

The current style of the status bar.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)