Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/115.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

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
Ios 编辑UITableViewCell时在单元格中放置UIActivityIndicator并禁用用户交互 当用户点击UITababVIEW中的删除按钮时(在编辑时),UIActuvyType在TabVIEW的中间显示,因为我想不出将它放在正在删除的单元格中间的方法。这是我现在正在使用的代码: - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { self.activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; //cell.accessoryView = self.activityView; self.activityView.center = self.tableView.center; [self.tableView addSubview:self.activityView]; [self.activityView startAnimating]; .... rest of the code_Ios_Objective C_Iphone_Uitableview_Uiactivityindicatorview - Fatal编程技术网

Ios 编辑UITableViewCell时在单元格中放置UIActivityIndicator并禁用用户交互 当用户点击UITababVIEW中的删除按钮时(在编辑时),UIActuvyType在TabVIEW的中间显示,因为我想不出将它放在正在删除的单元格中间的方法。这是我现在正在使用的代码: - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { self.activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; //cell.accessoryView = self.activityView; self.activityView.center = self.tableView.center; [self.tableView addSubview:self.activityView]; [self.activityView startAnimating]; .... rest of the code

Ios 编辑UITableViewCell时在单元格中放置UIActivityIndicator并禁用用户交互 当用户点击UITababVIEW中的删除按钮时(在编辑时),UIActuvyType在TabVIEW的中间显示,因为我想不出将它放在正在删除的单元格中间的方法。这是我现在正在使用的代码: - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { self.activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; //cell.accessoryView = self.activityView; self.activityView.center = self.tableView.center; [self.tableView addSubview:self.activityView]; [self.activityView startAnimating]; .... rest of the code,ios,objective-c,iphone,uitableview,uiactivityindicatorview,Ios,Objective C,Iphone,Uitableview,Uiactivityindicatorview,So 1) 第一个问题:如何将标识符视图放在正在删除的单元格的中间。 2) 在发生这种情况时,是否仍要禁用“删除”按钮?我不希望用户单击该按钮 EDIT1 我忘了提到我正在为cells Outlet使用自定义类。所以在一个普通的表格视图中,我用这个代码来获取每个单元格 GamesInfoTableViewCell *cell1 = (GamesInfoTableViewCell *)[tableView dequeueReusableCellWithIdentifier:otherSection

So 1)

第一个问题:如何将标识符视图放在正在删除的单元格的中间。

2) 在发生这种情况时,是否仍要禁用“删除”按钮?我不希望用户单击该按钮

EDIT1

我忘了提到我正在为cells Outlet使用自定义类。所以在一个普通的表格视图中,我用这个代码来获取每个单元格

GamesInfoTableViewCell *cell1 = (GamesInfoTableViewCell *)[tableView dequeueReusableCellWithIdentifier:otherSection];

试试这个代码。它会将子视图添加到您试图删除的单元格的中心

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete) {

        spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];

        UITableViewCell * cell = [tableView cellForRowAtIndexPath: indexPath];
        // Setting Frame of Spinner..
        CGFloat x = (cell.frame.size.width-spinner.frame.size.width)/2;
        CGFloat y = (cell.frame.size.height-spinner.frame.size.height)/2;

        spinner.frame = CGRectMake(x, y, spinner.frame.size.width, spinner.frame.size.height);

        [cell addSubview: spinner];

        [spinner startAnimating];
        //Do YOUR WORK NOW
    }
}

快乐编码:)

我忘了提一件事,请参见更新的问题。这不起作用,我想是因为这个原因吧?我将此代码添加到了您的解决方案[cell addSubview:self.activityView];旋转器出现在靠近PickerView的细胞下方。我好像没法把它放在牢房中间。也许这会帮你得到剩下的?你想删除哪个单元格?PickerView单元格或测试1-0单元格??测试1-0单元格。在您的代码中,除了我将此添加到代码中时,不会显示任何内容:[cell addSubview:self.activityView];微调器显示在PickerView附近。我想让旋转者出现在1-0单元格的中间,你使用内置的SypPotoDebug功能删除单元格,或者添加了删除按钮?