Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.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
Objective c 单击按钮时如何更改分段控制操作?_Objective C_Uibutton_Uisegmentedcontrol - Fatal编程技术网

Objective c 单击按钮时如何更改分段控制操作?

Objective c 单击按钮时如何更改分段控制操作?,objective-c,uibutton,uisegmentedcontrol,Objective C,Uibutton,Uisegmentedcontrol,您好,在我的应用程序中,我想在单击按钮时更改分段控制操作。这里我附加了我的图像 在上图中,默认分段控件为=0,当我单击+按钮时,分段控件更改为1。在按钮上单击更改分段控件->选择分段索引 Tempsegment.selectedSegmentIndex = 1; 并调用绑定值已更改的操作 - (IBAction)TempsegmentAction:(id)sender { if (Tempsegment.selectedSegmentIndex==0) {

您好,在我的应用程序中,我想在单击按钮时更改分段控制操作。这里我附加了我的图像


在上图中,默认分段控件为=0,当我单击+按钮时,分段控件更改为1。

在按钮上单击更改分段控件->选择分段索引

Tempsegment.selectedSegmentIndex = 1;
并调用绑定值已更改的操作

- (IBAction)TempsegmentAction:(id)sender 
{
    if (Tempsegment.selectedSegmentIndex==0) 
    {
       // for segment index 0
    }
    else
    {
      // for segment index 1
    }
}

在按钮上单击更改分段控件->selectedSegmentIndex

Tempsegment.selectedSegmentIndex = 1;
并调用绑定值已更改的操作

- (IBAction)TempsegmentAction:(id)sender 
{
    if (Tempsegment.selectedSegmentIndex==0) 
    {
       // for segment index 0
    }
    else
    {
      // for segment index 1
    }
}

分段控件的u绑定动作方法?分段控件的u绑定动作方法?