cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

在这个方法中

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

但是当我选择那个单元格时我只能看到它,否则它不可见。当背景为白色时它完美地工作。 我确信我需要设置一个属性,但我不知道需要更改哪个属性才能使这个功能正常工作。

提前感谢。

欢呼声。

有帮助吗?

解决方案

看起来公开指示器是灰色的高α图像,因此在黑色背景上覆盖使其不可见。如果你想这样做,你需要将你自己的UIImageView添加到单元格的contentView。

其他提示

我遇到了同样的问题,只是从UIView的imageWithName @" AccDisclosure.png"创建一个UIImageView。使用以下匆忙模拟的图形,您可以自由复制: http://thinkingman.com /db/downloads/AccDisclosure.png (如果你只是点击那个链接,你可能什么都看不见,因为它是一个带有透明背景的白色图像,但如果你保存它并在深色背景下查看,你我会看到阿尔法。

以下代码允许我在表格行中设置箭头提示的背景颜色:

@property (nonatomic,retain) UILabel *backgroundLabel;

UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
label.backgroundColor = [UIColor orangeColor]; 
self.backgroundLabel = label;
[self.contentView addSubview:label];
[label release];

CGRect labelRect = CGRectOffset(contentRect,0, 0);
labelRect.size.height = contentRect.size.height - 1; // show white line
labelRect.size.width = contentRect.size.width + 50; // cover arrow tip background
backgroundLabel.frame = labelRect;    
backgroundLabel.highlightedTextColor = [UIColor whiteColor];

我做了一个解决方案,我以正常的方式添加了一个带有addSubView的ImageView,在附件出现的位置有一个非黑色的图像(在我的例子中,是一个灰色的圆圈)。

这样可以看到箭头并且仍然具有深色/黑色表格单元格背景颜色。

也许不是最犹太的解决方案,但它使箭头可见,并且在没有子类化或编写大量代码的情况下收到附件点击的通知。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top