Skip to content

当我需要定制如图这样的动画,给按钮加border的时候,bug就出来了. #6

Description

@YanCeyMichael

当我需要定制如图这样的动画,给按钮加border的时候,bug就出来了
特别是当ppnumberButton.minValue <= 默认值 1 的时候, decreaseHide = YES的时候.
加号增加方法里的 逻辑上有漏洞.

2

所以我做了微调:
把你的源代码:

  • (void)setMinValue:(NSInteger)minValue {
    _minValue = minValue;
    _textField.text = [NSString stringWithFormat:@"%ld",minValue];
    }

改成了

  • (void)setMinValue:(NSInteger)minValue {
    _minValue = minValue;
    if (_decreaseHide) {
    _textField.text = [NSString stringWithFormat:@"%ld",minValue - 1];
    }else {
    _textField.text = [NSString stringWithFormat:@"%ld",minValue];
    }
    }

然后运行结果达到了我满意的状态,解决了+方法里的动画不执行的bug.

1gif

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions