I currently would like to change the status bar style when my navigation bar goes from large title to small title during scrolling of a table view. Is there an easy way of doing this?
I have tried to use
currentStyle = .lightContent
setNeedsStatusBarAppearanceUpdate()
but I can't get it to call at the right time (when the large title transitions to a normal title).
I really appreciate anybody who could help as this is the first app I have ever developed. Cheers.
As this is a TableView, it inherits from the the ScrollView delegate so I would use the following methods:
func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
/* The code that you will be using when the user starts scrolling,
In your case that woudl be changing your status bar style to another one
*/
}
func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
/* The code that you will be using when the user stops scrolling,
In your case that woudl be setting your status bar style back to original
*/
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.