I understand that you can change the color of the status bar with the code below.
override var preferredStatusBarStyle:UIStatusBarStyle{
return UISTatusBarStyle.lightContent
}
However, if I want to change the color when I press UIButton, what should I do?
I want to be able to change it with animation.
swift xcode swift4
You can use this method to reflect style.
setNeedsStatusBarAppearanceUpdate()
Indicators to the system that the view controller status bar attributes have changed.
Call this method if the view controller's status bar attributes, such as hidden/unhidden status or style, change.If you call this method with an animation block, the changes are animated along with the rest of the animation block.
537 Uncaught (inpromise) Error on Electron: An object could not be cloned
549 PHP ssh2_scp_send fails to send files as intended
709 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
548 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.