开发者

How to capture the user click "Tabbar" item action?

I have a applicat开发者_StackOverflowion with many views. For example, I have "A", "B", "C".... Both "A", "B" have a button to switch to "C". Also, I can click the tabbar "C" item to switch to "C". The question is, when I tab the tabbar to switch "C" is different from "B" and "A".

For example, if I click the A view's button, it will switch to "C", and the background color is red. if I click the B view's button, the color will become blue. But when I click on the tabbar, I want to color is yellow. So, I need to know, which class is calling the "C" view to display. What should I do? Thank you.


  1. Within tab bar item controller you can switch self.navigationController.tabBarController.selectedIndex
  2. Within tab bar controller delegate you can send a message to selected view controller by tabBarController:didSelectViewController
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜