Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.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
Uitableview 更改自定义单元格中EditingAccessoryView的位置_Uitableview_Xamarin.ios - Fatal编程技术网

Uitableview 更改自定义单元格中EditingAccessoryView的位置

Uitableview 更改自定义单元格中EditingAccessoryView的位置,uitableview,xamarin.ios,Uitableview,Xamarin.ios,我想在我的手机中移动EditingAccessoryView的位置。我尝试了以下方法,但没有成功: UIActivityIndicatorView activityIndicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.Gray); activityIndicator.Frame.X = 227f; cell.EditingAccessoryView = activityIndicator; 我用GetCell方

我想在我的手机中移动EditingAccessoryView的位置。我尝试了以下方法,但没有成功:

UIActivityIndicatorView activityIndicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.Gray);
activityIndicator.Frame.X = 227f;
cell.EditingAccessoryView = activityIndicator;
我用GetCell方法来做这件事

如有任何想法,将不胜感激

谢谢, 瑞克

那怎么办

cell.editingAccessoryView.frame = CGRectMake(0, 0, 40, 40);

解释:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *cellIdentifier = @"cellIdentifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];

    if(cell == nil) {
        cell =  [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier];
        cell.editingAccessoryView.frame = CGRectMake(0, 0, 40, 40);
     }
return cell;
}
那怎么办

cell.editingAccessoryView.frame = CGRectMake(0, 0, 40, 40);

解释:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *cellIdentifier = @"cellIdentifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];

    if(cell == nil) {
        cell =  [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier];
        cell.editingAccessoryView.frame = CGRectMake(0, 0, 40, 40);
     }
return cell;
}