【问题标题】:I saw double chevron in my disclosure indicator. Why and how to fix this? [closed]我在披露指标中看到了双 V 形。为什么以及如何解决这个问题? [关闭]
【发布时间】:2013-10-11 07:43:37
【问题描述】:

V形之间的距离受UITableViewCell的宽度影响。如果小于 320 会更大。

为了清晰起见,我特意将 contentView 的背景设为绿色。

设置 UITableViewCell 的背景会使单元格不可见。

当表格处于编辑模式时,只有第一个 V 形变为移动单元格符号。

注意:我所有的 UITableViewCell 类都是使用特殊技术创建的。基本上我用 UITableViewCell 加载一个 xib,然后我要创建的单元格吸收该 UITableViewCell 的属性

这里是完整的代码:

-(id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        //[self vLoadMainBundle];
        //self=(BGBaseTableViewCell *)self.view;
        [self BaseInitialize];
    }
    return self;

}


- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self BaseInitialize];
        //[self vLoadMainBundle];
        //self=(BGBaseTableViewCell *)self.view;
    }
    return self;
}

-(void) vLoadMainBundle
{
    if ([self class] == [BGBaseTableViewCell class])
    {
        return;
    }

    NSString * className = NSStringFromClass([self class]);

    [[NSBundle mainBundle] loadNibNamed:className owner:self options:nil];
}
-(void) vAfterLoadMainBundle
{
    //self=self.view;

    self.contentView.frame =self.view.contentView.frame;
    self.frame=self.view.frame;
    //self.contentView.frame=self.contentView.frame;

    [self.contentView kidnapChildrenAndAttributes:self.view.contentView];
    [self kidnapChildrenAndAttributes:self.view];
    self.editingAccessoryType= self.view.editingAccessoryType;
    self.accessoryType = self.view.accessoryType;
    self.selectionStyle =self.view.selectionStyle;

    //PO1(@(self.editingAccessoryType));
    //PO1(@(self.accessoryType));
    //PO1(@(self.selectionStyle));
    while (false);

    [self.view removeFromSuperview];
    //self.view=nil;
    PO(self.view);
    PO(self.view.subviews);
    self.view.hidden=true;
    [self furtherCustomInitializer];
}
-(void)BaseInitialize
{
    [self vLoadMainBundle];
    [self vAfterLoadMainBundle];
}

在 iOS 6 上完美运行

我注意到我绘制东西的原始视图仍在绘制中。因此,

【问题讨论】:

  • 你的问题到底是什么?
  • 为什么以及如何解决这个问题?

标签: objective-c xcode5


【解决方案1】:

我在参考中找不到任何内容,但我认为这就是附件视图在 iOS 7 上的工作方式。 您可以通过提供要在附件视图中显示的自定义图像来解决此问题。像这样:

myCell.accessoryView = [[ UIImageView alloc ] 
                   initWithImage:[UIImage imageNamed:@"Something" ]];

这里也有描述:How can I customize the accessory disclosure image in a UITableViewCell?

【讨论】:

  • 你确定吗?我认为配件视图是单个 V 形?
  • @JimThio 好吧,我无法证明这一点。但你说这取决于细胞的大小。我的意思是如果右边有很多空间,人字形可能会变大。你不能只是调整你的单元格大小以始终具有相同的右边缘间距,以便 V 形显示正常。在我的应用程序中,人字形位于单元格中或上方。我的单元格是全宽的,并且 V 字形出现在单元格内。
  • 我的代码创建 UITableViewCell 的方式是问题所在。
猜你喜欢
  • 2016-06-09
  • 2021-01-10
  • 1970-01-01
  • 1970-01-01
  • 2021-01-17
  • 2020-11-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多