UISegmentedControl not centered on UINavigationController when added programmatically
I'm using the following code in my root view controller class implementation:

- (void)viewDidLoad 
{
	[super viewDidLoad];
	
	NSArray *segmentTextContent = [NSArray arrayWithObjects:
								   NSLocalizedString(@"button1", @""),
								   NSLocalizedString(@"button2", @""),
								   NSLocalizedString(@"button3", @""), nil];

	UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] nitWithItems:segmentTextContent];
	segmentedControl.selectedSegmentIndex = 0;
	segmentedControl.autoresizingMask = UIViewAutoresizingFlexibleWidth;
	segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
	segmentedControl.frame = CGRectMake(0, 0, 400, 30);
	
	self.navigationItem.titleView = segmentedControl;
	[segmentedControl release];
}


The segmented control is not centered correctly, it is shifted a few pixels to the right.  The funny thing is, it is not right-aligned either.  It's as if there is some left padding preventing it from being centered.  Another funny thing is, if I draw this segmented control in interface builder, it centers perfectly, so this is only a programmatic issue.

I've tried this code in a brand new empty app and get the same results, so I know it's not something else in my app that is causing it.

Sorry, I wanted to post a screen shot, but I don't have enough reputation points ;-)

Any Ideas?
UISegmentedControl not centered on UINavigationController when added programmatically
===

I'm using the following code in my root view controller class implementation:

- (void)viewDidLoad 
{
	[super viewDidLoad];
	
	NSArray *segmentTextContent = [NSArray arrayWithObjects:
								   NSLocalizedString(@"button1", @""),
								   NSLocalizedString(@"button2", @""),
								   NSLocalizedString(@"button3", @""), nil];

	UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] nitWithItems:segmentTextContent];
	segmentedControl.selectedSegmentIndex = 0;
	segmentedControl.autoresizingMask = UIViewAutoresizingFlexibleWidth;
	segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
	segmentedControl.frame = CGRectMake(0, 0, 400, 30);
	
	self.navigationItem.titleView = segmentedControl;
	[segmentedControl release];
}


The segmented control is not centered correctly, it is shifted a few pixels to the right.  The funny thing is, it is not right-aligned either.  It's as if there is some left padding preventing it from being centered.  Another funny thing is, if I draw this segmented control in interface builder, it centers perfectly, so this is only a programmatic issue.

I've tried this code in a brand new empty app and get the same results, so I know it's not something else in my app that is causing it.

Sorry, I wanted to post a screen shot, but I don't have enough reputation points ;-)

Any Ideas?