|
|
|
|
|
|
|
|
battery.translatesAutoresizingMaskIntoConstraints = NO; |
|
|
battery.translatesAutoresizingMaskIntoConstraints = NO; |
|
|
//[battery.widthAnchor constraintEqualToAnchor:[self stackView].widthAnchor].active = YES; |
|
|
//[battery.widthAnchor constraintEqualToAnchor:[self stackView].widthAnchor].active = YES; |
|
|
//[battery.heightAnchor constraintEqualToConstant:(battery.number * 85)].active = YES; |
|
|
//[battery.heightAnchor constraintEqualToConstant:(battery.number * 85)].active = YES; |
|
|
[battery.heightAnchor constraintEqualToConstant:100].active = YES; |
|
|
|
|
|
|
|
|
//[battery.heightAnchor constraintEqualToConstant:100].active = YES; |
|
|
originalBattery = battery.frame; |
|
|
originalBattery = battery.frame; |
|
|
original = [self stackView].frame; |
|
|
original = [self stackView].frame; |
|
|
[[NSNotificationCenter defaultCenter] addObserver:self |
|
|
[[NSNotificationCenter defaultCenter] addObserver:self |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
battery.translatesAutoresizingMaskIntoConstraints = NO; |
|
|
battery.translatesAutoresizingMaskIntoConstraints = NO; |
|
|
//[battery.widthAnchor constraintEqualToAnchor:[self stackView].widthAnchor].active = YES; |
|
|
//[battery.widthAnchor constraintEqualToAnchor:[self stackView].widthAnchor].active = YES; |
|
|
//[battery.heightAnchor constraintEqualToConstant:(battery.number * 85)].active = YES; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[[self stackView] removeArrangedSubview:battery]; |
|
|
|
|
|
int height = (battery.number * 85); |
|
|
|
|
|
[battery.heightAnchor constraintEqualToConstant:height].active = YES; |
|
|
|
|
|
[[self stackView] addArrangedSubview:battery]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
%new |
|
|
%new |