Hello everyone, my requirements are as follows. I want to customize a search bar with a style like this. It's actually simpler than the one below. I didn't ask for the button on the right. I've achieved it. But the way I implemented it was to hide the IOS navigation bar, and then I DIYed a view of 0, 0, screenWidth, 64. I achieved exactly the effect I wanted. But he had a very bad bug, that is, when I pushed to the next controller, when I used the pop gesture to return [but did not completely pop back], I then canceled the gesture operation. At this time, when the controller I am in pushes to the next controller again, the buttons in the navigation bar in the upper right corner of the current controller are still displayed as the buttons in the navigation bar of the controller when I pushed the first time. The reason for this bug is that I hid the navigation bar on the first interface. I don't know how to solve it. Is it because I can't customize it like this? Or should I assign a value to self.nav.titleView directly? So what exactly should I do? Is there any simple way to solve my bug? I don't want to deal with him by banning the pop gesture. Please also ask God for advice. Thank you!