简体   繁体   中英

the best way to add custom button on tabbar center

when I use way to custom button like this What's the best way of adding a custom centre button to a tab bar?

[tabbarcontroller.view addsubview:button]

to add custom button on the view ,the navigationcontroller push to other viewController will use the method hidesBottomBarWhenPushed to hide the tabbar , but the button would stay on screen

or I use this [tabbarcontroller.tabBar addsubview:button] way to add on tabbar ,but my button would covered by the tabbar and can not receive the touch event.

please tell me the way to fix it ,and thanks for your answer

The problem of your first option is that it's not hiding ? If so, you can hide it manually.

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