After going through all the answers so far and trial and error in interface builder the problem is sorted for me after the following steps:
(xcode 13 , iOS 13)
choose standard and scroll edge appearances for the navigation bar.
set both appearances to be the same.
Good luck