简体   繁体   English

在标签栏中心添加自定义按钮的最佳方法

[英]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 要在视图上添加自定义按钮,navigationcontroller推到其他viewController会使用hidesBottomBarWhenPushed方法来隐藏hidesBottomBarWhenPushed ,但是该按钮会保留在屏幕上

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. 或者我使用这种[tabbarcontroller.tabBar addsubview:button]方法添加到[tabbarcontroller.tabBar addsubview:button] ,但是我的按钮将被[tabbarcontroller.tabBar addsubview:button]覆盖,并且无法接收触摸事件。

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. 如果是这样,您可以手动隐藏它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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