From 51daca353500ce6b5d65c34cae54c786452cd81c Mon Sep 17 00:00:00 2001 From: Burrit0z Date: Wed, 3 Jun 2020 10:04:09 -0400 Subject: [PATCH] issue was not setting number --- KAIBatteryPlatter.mm | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/KAIBatteryPlatter.mm b/KAIBatteryPlatter.mm index 76781a6..2828f3f 100755 --- a/KAIBatteryPlatter.mm +++ b/KAIBatteryPlatter.mm @@ -121,11 +121,6 @@ long long lastPercentage; [super setContentOffset:CGPointMake(arg1.x, 0)]; } --(void)setNumber:(NSInteger)arg1 { - _number = arg1; - [self calculateHeight]; -} - -(void)addSubview:(UIView *)view { [super addSubview:view]; self.number = [self.stack.subviews count]; @@ -157,6 +152,8 @@ long long lastPercentage; } -(void)calculateHeight { + self.number = [self.stack.subviews count]; + [UIView animateWithDuration:0.3 animations:^{ if(!self.heightConstraint) { @@ -169,14 +166,12 @@ long long lastPercentage; } else { int height = (self.number * (bannerHeight + spacing)); - if(kaiAlign==0) { - height = (self.number * (bannerHeight + spacing)); - } else { + if(kaiAlign!=0) { height = bannerHeight + spacing; } if([self.superview.subviews count]>1) { - height = height - spacing; + height = (height - spacing) + 1; } self.heightConstraint.constant = height; self.stack.heightConstraint.constant = height;