Iphone -更新UITabBarItem的UISegmentedControl-
我发现我不能这么做,只是为了确定,有没有可能在不重新创建整个控件的情况下禁用分段控件的一个按钮 例如: [self.navigationItem.RightBarButtonim.AccessToySegmentedControl setEnabled:否…] 干杯,伙计们Iphone -更新UITabBarItem的UISegmentedControl-,iphone,Iphone,我发现我不能这么做,只是为了确定,有没有可能在不重新创建整个控件的情况下禁用分段控件的一个按钮 例如: [self.navigationItem.RightBarButtonim.AccessToySegmentedControl setEnabled:否…] 干杯,伙计们 Gauthier在控制器中保留对分段控件的引用,如下所示: 福安 富美 然后您可以始终使用segmentedControl访问分段控件。做得好;真的很容易,但我想都没想:D谢谢。 @interface Foo : UIVie
Gauthier在控制器中保留对分段控件的引用,如下所示: 福安 富美
然后您可以始终使用segmentedControl访问分段控件。做得好;真的很容易,但我想都没想:D谢谢。
@interface Foo : UIViewController {
UISegmentedControl *segmentedControl;
}
segmentedControl = [[UISegmentedControl alloc] initWithItems:items];
segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
UIBarButtonItem *bar = [[UIBarButtonItem alloc] initWithCustomView:segmentedControl];
[self.navigationItem setRightBarButtonItem:bar];
[bar release];