Skip to content

Commit

Permalink
适配当只有删除一个功能时的显示
Browse files Browse the repository at this point in the history
  • Loading branch information
lengningLN committed Aug 14, 2018
1 parent f345950 commit 858fbe1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions LNSwipeCellDemo/LNSwipeCell/LNSwipeCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ - (void)buttonClick:(UIButton *)button
int index = (int)[self.buttons indexOfObject:button];
//这里假设为微信的功能,可更需需要自行修改
if (index == 0) {
if (button.width == _totalWidth) {
if ([[button titleForState:UIControlStateNormal] isEqualToString:@"确认删除"]) {
[self close:YES];
[self.swipeCellDelete swipeCell:self didSelectButton:button atIndex:index];
}else{
Expand All @@ -403,7 +403,10 @@ - (void)deleteAction:(UIButton *)button
initialSpringVelocity:5.0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
button.frame = CGRectMake(button.x-(self->_totalWidth-button.width), 0, self->_totalWidth, button.height);
if (button.width == self.totalWidth) {
self.ln_contentView.x -= 25;
}
button.frame = CGRectMake(self.ln_contentView.width+self.ln_contentView.x, 0, ABS(self.ln_contentView.x), button.height);
[button setTitle:@"确认删除" forState:UIControlStateNormal];
} completion:^(BOOL finished){

Expand Down

0 comments on commit 858fbe1

Please sign in to comment.