Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/vim/5.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
Iphone 在contentView后面隐藏UITableView分隔符_Iphone_Cocoa Touch_Uitableview_Separator - Fatal编程技术网

Iphone 在contentView后面隐藏UITableView分隔符

Iphone 在contentView后面隐藏UITableView分隔符,iphone,cocoa-touch,uitableview,separator,Iphone,Cocoa Touch,Uitableview,Separator,我在iPhoneOS3.0中制作了一个分组的UITableView,看起来像左图。结果是OS3.1中的正确映像 imageView位于分隔符下方 我尝试将内容视图放在前面。当tableView采用分组样式时(自己绘制分隔符),分隔符样式的适当性似乎被忽略。更改分隔符颜色将生成字符串结果 谢谢你的帮助 编辑:这是未做任何更改的代码: static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView deq

我在iPhoneOS3.0中制作了一个分组的UITableView,看起来像左图。结果是OS3.1中的正确映像

imageView位于分隔符下方

我尝试将内容视图放在前面。当tableView采用分组样式时(自己绘制分隔符),分隔符样式的适当性似乎被忽略。更改分隔符颜色将生成字符串结果

谢谢你的帮助

编辑:这是未做任何更改的代码:

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.textLabel.font = [UIFont boldSystemFontOfSize:18.0];
}

cell.textLabel.text = [[metro.arretDirection objectAtIndex:indexPath.row] name];

NSString* name;
if (indexPath.row == 0) {
    name = @"Begining";
}
else if (indexPath.row + 1 == [metro.arretDirection count]) {
    name = @"End";
}
else {
    if ([[[metro.arretDirection objectAtIndex:indexPath.row] lines] count]== 1) name = @"Little";
    else name = @"Big";
}

UIImage* metroImage = [[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[NSString stringWithFormat:@"%i%@.png", metro.metroNumber, name]]];
cell.imageView.image = metroImage;
[metroImage release];

return cell;

在单元格上,尝试设置为NO.eg
cell.clipsToBounds=NO

答案其实很简单,只需在单元格中添加一个
UIImageView
,将其正确放置,而不是使用内置的imageView。

这很奇怪。您能发布相关代码吗?在3.1中,imageView的大小可能缩小了2个像素,因此请将imageView的框架写入日志,然后查看它的说明。还要查看imageView的
contentMode
在3.0中是什么,以及它与3.1的比较,还可以尝试imageView的
clipsToBounds
属性。甚至可能是imageView的层的
masksToBounds
属性(尽管这应该已经设置为否)。