Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/95.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
如何创建在iOS中选择时展开的选项卡_Ios_Ipad_Uitableview - Fatal编程技术网

如何创建在iOS中选择时展开的选项卡

如何创建在iOS中选择时展开的选项卡,ios,ipad,uitableview,Ios,Ipad,Uitableview,我想创建一个在用户选择时展开的表视图或选项卡。这在使用jquery的网页中非常常用。 你可以检查它是否完全符合我在ipad应用程序中想要做的。还有水平标签 有人能告诉我如何在我的iPad应用程序中实现这一点吗?或者任何指点都将不胜感激 短暂性脑缺血发作 Sam最好的方法是使用headerview显示主行和tableview单元格以显示详细信息行。为headerview编写一个触摸事件,并将其设置为显示和隐藏单元格,使用整齐的行动画。您需要保持单元格的打开和关闭状态,并使用重复masterview

我想创建一个在用户选择时展开的表视图或选项卡。这在使用jquery的网页中非常常用。 你可以检查它是否完全符合我在ipad应用程序中想要做的。还有水平标签

有人能告诉我如何在我的iPad应用程序中实现这一点吗?或者任何指点都将不胜感激

短暂性脑缺血发作
Sam

最好的方法是使用headerview显示主行和tableview单元格以显示详细信息行。为headerview编写一个触摸事件,并将其设置为显示和隐藏单元格,使用整齐的行动画。您需要保持单元格的打开和关闭状态,并使用重复masterview编号的布尔数组。

1。使用UITableView作为第一种选项卡

a) 使用所需格式的标题和单元格视图

b) 使用一些动画隐藏和取消隐藏单元格视图

2.对第二种类型的选项卡使用UISegementedControl

a) 使用函数addTarget:

[self.mySegmentedControl addTarget:self action:@selector(segmentChanged) forControlEvents:UIControlEventValueChanged];
b) 已更改的实施分段:

- (void) segmentChanged:(UISegmentedControl *)paramSender{

//check if its the same control that triggered the change event
 if ([paramSender isEqual:self.mySegmentedControl]){

    //get index position for the selected control
    NSInteger selectedIndex = [paramSender selectedSegmentIndex];

   if (selectedIndex == 1 ) { // do required } and so on....

  }
}
看到这一点,我检查了和其他库,如,但最终用定制的headerView实现了我自己的解决方案。这里有一个很好的教程,对我很有帮助。谢谢