CEWendel / SWTableViewCell

An easy-to-use UITableViewCell subclass that implements a swippable content view which exposes utility buttons (similar to iOS 7 Mail Application)
MIT License
7.14k stars 1.27k forks source link

Cell's content doesn't move when it swiped #215

Open EgorkZe opened 10 years ago

EgorkZe commented 10 years ago

I inserted code: 2014-08-06 13 42 57

   static NSString *MyIdentifier = @"MyReuseIdentifier";
      SWTableViewCell *cell = (SWTableViewCell*)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
     if (cell == nil) {

     cell = [[SWTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault  reuseIdentifier:MyIdentifier];
     cell.rightUtilityButtons = [self rightButtons];
     cell.delegate = self;

But Utility Button overlays cell's content and not move it

mnearents commented 9 years ago

I have the same problem but only with the cell accessory disclosure indicator. I implemented this on a cell that drills down to another screen, so they can swipe or click. If they swipe, the little arrow on the right side does not move. Any way to detect the swipe and hide the disclosure indicator?

powerje commented 9 years ago

@lususvir I am running into the same issue. Did you find a fix?

mnearents commented 9 years ago

I didn't find a fix for it. I think I just hid the accessory disclosure indicator and put an icon there so that it moved with the rest of the content.

powerje commented 9 years ago

Thanks for the response!

That's basically what I've settled on as well.

vdeep commented 9 years ago

I'm having the same issue as @lususvir. It's just the disclosure indicator that doesn't move. Also, the bottom separators of the cells are having some right margin, which I didn't set. screen shot 2015-03-03 at 6 27 56 pm

vdeep commented 9 years ago

Just found out that programmatically setting the accessoryType (after setting right/left utility buttons) works fine. The problem only occurs when the accessoryType has been set in nib/storyboard (tried both).

powerje commented 9 years ago

Interesting. I'm not using nibs but I do have this issue. I set the accessoryType programmatically but before setting utility buttons.

fpena commented 9 years ago

I faced this same issue, and it had to do with adding subviews manually in the code.

I solved it by creating the elements in the xib/storyboard and then connect them with outlets in the class. It helps also adding auto layout constraints to the elements from the cell.

StevenTso commented 8 years ago

If you are subclassing SWTableViewCell, pragmatically creating your view, add it to self, use autolayout, this behavior exists as well. It's kind of a hacky solution right now, but I was able to get past it by adding my subviews to self.subview[0].subview[0] and set my constraints around this as the superview. This work because the scrolling piece hooks on to self.subview[0].subview[0] if I'm not mistaken.