你可以以编程方式更改UITableView创建后的样式吗?

Ank*_*han 25 iphone uitableview

(这是以编程方式交换现有tableview的样式而不是以编程方式设置表视图样式)

我有一种情况,我在一个视图中使用分组表视图这个表是可编辑的,每当它进入可编辑视图时它就会被取代,所以我认为只要它进入编辑模式就将它的样式改为plain.

这可能吗?(提前致谢.)

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *MyIdentifier = @"MyIdentifier";
MyIdentifier = [NSString stringWithFormat:@"Cell %d",indexPath.row];


 // MyIdentifier =@"tblCellView";
    NSString *offendersImagePath = [self applicationDocumentsDirectory];
    //NSLog(@"%@", dbPath);
    offendersImagePath=[offendersImagePath stringByAppendingPathComponent:@"Images"];


CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if(cell == nil) {
    [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
    cell = aCustomCell;
    aCustomCell=nil;
}
Run Code Online (Sandbox Code Playgroud)

Gyp*_*psa 56

不,这是不可能的请参阅这是苹果文档中的wriiten: -

初始化表视图时设置表样式(请参阅initWithFrame:style :).此后您无法修改样式.

所以你以后不能修改它......