-2

enter image description here

The distance between chevron is affected by the width of UITableViewCell. If it's less than 320 it'll be even bigger.

I deliberately make the background of my contentView to be green for clarity.

Setting the background of UITableViewCell will make the cell unseenable.

Only the first chevron turn into a move cell sign when table is in edit mode.

enter image description here

Note: All of my UITableViewCell class is created with a special technique. Basically I load an xib with a UITableViewCell, and then the cell I want to create absorb the property of that UITableViewCell

Here is the full code:

-(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];
}

Works perfectly fine on iOS 6

It has come to my attention that the original view where I draw stuffs are still being drawn. Hence,

user4951
  • 32,206
  • 53
  • 172
  • 282

1 Answers1

1

I could not find anything in the reference but I assume this is just how the accessory view is intended to work on iOS 7. You can work around this by providing a custom image to be displayed in the accessory view. Like so:

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

This also described here: How can I customize the accessory disclosure image in a UITableViewCell?

Community
  • 1
  • 1
codingFriend1
  • 6,487
  • 6
  • 45
  • 67
  • Are you sure? I thought accessories view is a single chevron? – user4951 Oct 11 '13 at 08:55
  • @JimThio well I cannot proof it. But you said it depends on the size of the cell. I mean if there is a lot of space on the right, the chevron might grow bigger. Can't you just adjust your cell size to always have the same right-edge spacing so the chevron appears normal. In my Apps the chevron lies in or above the cell. My cells are full width and the chevron appears inside the cell. – codingFriend1 Oct 11 '13 at 12:01
  • The way my code create the UITableViewCell was the problem. – user4951 Oct 15 '13 at 05:26