sakkaras / SKSTableView

An expandable table view.
MIT License
446 stars 115 forks source link

expansion indicator position #58

Closed skander300 closed 7 years ago

skander300 commented 7 years ago

hi , could i move expansion indicator (arrow) to the left ?

skander300 commented 7 years ago

in SKSTableView.m

- (void)layoutSubviews
{
    [super layoutSubviews];

  //put accessoryView to the left
// you modify your accessory position as you like
    self.accessoryView.frame = CGRectMake(10, (self.frame.size.height - (self.accessoryView.frame.size.height / 2)) / 2, self.accessoryView.frame.size.width, self.accessoryView.frame.size.height);
    self.textLabel.frame = CGRectMake(self.accessoryView.frame.origin.x+20, self.textLabel.frame.origin.y, self.textLabel.frame.size.width, self.textLabel.frame.size.height);

    if (self.isExpanded) {

        if (![self containsIndicatorView])
            [self addIndicatorView];
        else {
            [self removeIndicatorView];
            [self addIndicatorView];
        }
    }
}