简体   繁体   中英

How to avoid barbuttonitem to overlap in Swift

i've been trying to hide a bar button that keeps appearing under my "Menu" barbuttonitem

You can see under the "Menu" button it says "Atras" which was a button from the last viewcontroller

BarButtonItemImageUpload

Can you try to check if the bar button item is not nil. If it is not, set it to nil first and then add the intended bar button item there.

In my case, I just disabled edge swiping in my UINavigationController to prevent this from happening.

self.navigationController?.interactivePopGestureRecognizer?.enabled = false

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM