Hi Gerry,

I like the sound of that. I don't use IB though. (It seems like there's
always stuff that I have to do programmatically, and when I move back and
forth between IB things get screwed up in ways that I'm not good enough yet
to fix, so I just stopped trying to use IB for anything. It's been easier
for me to work entirely programmatically.) I assume you're approach could be
done programmatically, but I have a few questions about what you're doing. 

If I understand what you're saying, you have a MainViewController (a
UIViewController) let's say. You create a UITabBar object and add it to your
MainViewController. Then you are handling when a tab button is touched
yourself. Let's say you have a Settings tab, and when it's tapped you're
going to have a UITableView with settings options called SettingsView. So
when the Settings tab is tapped, you're adding this SettingsView as a
subview to your MainViewController. Do I have that right? 

Is there any way that you could post a code sample, or link to one? 

Thanks again, Gerry.


--Chris
 


Gerry High wrote
> 
> I just did something like this today.  The way I did it was to add a
> UITabBar to my view in IB and then manually handle the tabbing myself
> (e..g tabBar.Selected +=….).  When a tab is clicked on I create a view
> controller and add it to the view (e.g.
> this.View.AddSubview(tab1ViewController.View) and hide whatever is the
> current view for the current tab, etc.  It works and I don't have to mess
> with swapping out a tab bar controller with a nav bar controller (in my
> case), etc.
> 
> On Jun 15, 2012, at 3:33 PM, Chris_M <kungfuchris99@> wrote:
> 
>> 
>> The examples I have found for using a UITabBarController use the tab bar
>> as
>> the sole means of navigating from that view -- the tab bar in effect is
>> the
>> view (and whatever it displays as a result of a button being tapped). 
>> 
>> But let's say that I have a MainViewController (a UIViewController) that
>> has
>> some buttons at the top part of the screen, a UITableView in the middle.
>> At
>> the bottom of the screen I want to have a tab bar with some buttons that,
>> when tapped, bring up a new view, with the idea that the user can then
>> tap
>> the "Back" button on the nav bar of the new views to return again to the
>> MainViewController. 
> 

--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/Problem-Adding-a-Tab-Bar-to-My-Main-View-tp4655417p4655451.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to