2
我试图通过编程方式将UISegementedControl添加到导航栏的左侧。我可以通过将控件设置为titleView来显示它,如下所示。以下是我的代码无法获得导航栏左侧的分段控件
NSArray *buttonNames = [NSArray arrayWithObjects:@"One", @"Two", nil];
UISegmentedControl* segmentedControl = [[UISegmentedControl alloc]
segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
// instead of the following I would like to move to left side of the nav bar
self.navigationItem.titleView = segmentedControl;
任何帮助表示赞赏。
感谢您的帮助。这工作。 – Rocky 2011-03-14 16:03:46