Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks to <a href="https://stackoverflow.com/questions/742829/animating-custom-drawn-uitableviewcell-when-entering-edit-mode/743856#743856">Craig's answer</a> which pointed me in the right direction, I have a solution for this. I reverted my <a href="http://github.com/adamalex/fast-scrolling/commit/eb88ffd7af320cd55eda230f204251644dca4fbf" rel="nofollow noreferrer">commit</a> which moved the text position based on the editing mode and replaced it with <a href="http://github.com/adamalex/fast-scrolling/commit/5cef99dfa4697b9d8d89185d3b3ab8edb7cb532d" rel="nofollow noreferrer">a new solution</a> that sets the entire content view to the correct position any time layoutSubviews is called, which results in an automatic animation when switching to and from edit mode:</p> <pre><code>- (void)layoutSubviews { CGRect b = [self bounds]; b.size.height -= 1; // leave room for the separator line b.size.width += 30; // allow extra width to slide for editing b.origin.x -= (self.editing) ? 0 : 30; // start 30px left unless editing [contentView setFrame:b]; [super layoutSubviews]; } </code></pre> <p>By doing it this way I was able to remove the setFrame: override found in ABTableViewCell.m because its former logic plus my additions are now found in layoutSubviews. </p> <p>I set a light grey background on the cells to verify a custom background works properly without allowing us to see behind it as it moves back and forth and it seems to work great.</p> <p>Thanks again to Craig and anyone else who has looked into this.</p> <p>GitHub commit for this solution: (<a href="http://github.com/adamalex/fast-scrolling/commit/5cef99dfa4697b9d8d89185d3b3ab8edb7cb532d" rel="nofollow noreferrer">link</a>)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload