How do I create a view(Shows balance) that stays onscreen while I switch between tabs? [duplicate]

StackOverflow https://stackoverflow.com/questions/9275733

Question

Possible Duplicate:
How do I create a view that stays onscreen while I switch between tabs?

i have a tab bar conttoller, i wanted to create a view(it dispalys balance). I wanted that view to be displayed on top through out my application. How can create such a view???

Était-ce utile?

La solution

this way, you have to put the tabbar inside a view first (you should start with a plain view project or other project except for tabbar project)

so what u want to do is

  1. start with a plain view project (my choice)
  2. in header, put tabbardelegate
  3. in header, create TabBarController variable (for instead : myTabBar)
  4. populate the myTabBar in the implementation file
  5. add the myTabBar to the view by using [self.view addSubView:myTabBar.view]
  6. after you added the tabbar as a subview, proceed into making your new view (the one with balance)
  7. add the new view as a subview of the main parent view

this way, the balance view will place above the tabbar view, meaning, it will always be displayed above the tabBar

its quite simple, really, if u have rather complex codes, you can always insert the subview by index such as :

[self.view insertSubview:theView atIndex:theIndex]

or

[self.view insertSubview:balanceView aboveSubview:myTabBar.view]
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top