Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone -更新UITabBarItem的UISegmentedControl-_Iphone - Fatal编程技术网

Iphone -更新UITabBarItem的UISegmentedControl-

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

我发现我不能这么做,只是为了确定,有没有可能在不重新创建整个控件的情况下禁用分段控件的一个按钮

例如:

[self.navigationItem.RightBarButtonim.AccessToySegmentedControl setEnabled:否…]

干杯,伙计们


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];