|
|
|
|
|
|
|
|
[super setContentOffset:CGPointMake(arg1.x, 0)]; |
|
|
[super setContentOffset:CGPointMake(arg1.x, 0)]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
-(void)setNumber:(NSInteger)arg1 { |
|
|
|
|
|
_number = arg1; |
|
|
|
|
|
[self calculateHeight]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
-(void)addSubview:(UIView *)view { |
|
|
-(void)addSubview:(UIView *)view { |
|
|
[super addSubview:view]; |
|
|
[super addSubview:view]; |
|
|
self.number = [self.stack.subviews count]; |
|
|
self.number = [self.stack.subviews count]; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
-(void)calculateHeight { |
|
|
-(void)calculateHeight { |
|
|
|
|
|
self.number = [self.stack.subviews count]; |
|
|
|
|
|
|
|
|
[UIView animateWithDuration:0.3 animations:^{ |
|
|
[UIView animateWithDuration:0.3 animations:^{ |
|
|
|
|
|
|
|
|
if(!self.heightConstraint) { |
|
|
if(!self.heightConstraint) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
int height = (self.number * (bannerHeight + spacing)); |
|
|
int height = (self.number * (bannerHeight + spacing)); |
|
|
if(kaiAlign==0) { |
|
|
|
|
|
height = (self.number * (bannerHeight + spacing)); |
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
if(kaiAlign!=0) { |
|
|
height = bannerHeight + spacing; |
|
|
height = bannerHeight + spacing; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if([self.superview.subviews count]>1) { |
|
|
if([self.superview.subviews count]>1) { |
|
|
height = height - spacing; |
|
|
|
|
|
|
|
|
height = (height - spacing) + 1; |
|
|
} |
|
|
} |
|
|
self.heightConstraint.constant = height; |
|
|
self.heightConstraint.constant = height; |
|
|
self.stack.heightConstraint.constant = height; |
|
|
self.stack.heightConstraint.constant = height; |