开发者

xCode Is there a way to create a relation between back button and tabbar?

开发者 https://www.devze.com 2023-04-09 01:03 出处:网络
Hi I am a new bee to iPad development. I have created a Tabbar application in xcode and created 5 tabs. I am able to load 5 different views. Each view consists of a navigation bar cont and tabbar by d

Hi I am a new bee to iPad development. I have created a Tabbar application in xcode and created 5 tabs. I am able to load 5 different views. Each view consists of a navigation bar cont and tabbar by default. I have added a bac开发者_运维知识库k button to navigation bar to the four tabs. When in the detail pages i.e., Tab 2 I am tapping on the back button it returns to the Home page(First Tab View). and I go to other tabs and when I return to the 2nd tab home page is displayed. To my understanding when I am clicking on the back button a new layer is been created. if this so then how can I reload the view in the tabs when I revisit the tab

Can anybody let me know what could be the problem.

Thanks in advance, Kris


Difficult to understand your exact problem from your description, but reading between the lines it sounds like you've set the tab bar / view controller structure up wrong to me. I have created a similar app in the past where I have a tabbar in the root view controller and then 3 navigation view controllers each assigned to a tab of the tab bar (but there's only one instance of the tab bar - reading your message it seems like you have one for each navigation view controller?)

Thinking about this more, if you are creating a new tab bar with each navigation view controller, then when you tap on another tab you are creating yet another view controller and before long you would have a massive number of view controllers and tab bars active. You should only have one tab bar in your app.

If you have it set up correctly when you switch tabs you should return to whatever level of pushed view controllers you previously had within each tab. Are you by any chance having to recreate the view controllers when the tab switch somehow?

0

精彩评论

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

关注公众号