锁定屏幕上的时钟

时间:2019-07-10 18:02:04

标签: ios objective-c iphone

我试图将时钟放在屏幕底部的锁定屏幕上,但我无法确定这些代码行之后时钟不会掉落。

时钟设法从右向左以及向中心移动。 我希望时钟在锁定屏幕的底部

   -(void)setAlignment:(int)alignment {
    if(alignment == 0) {
        //Left
      self.speculumStackView.alignment = UIStackViewAlignmentLeading;
      [self.speculumStackView.leftAnchor constraintEqualToAnchor:self.leftAnchor].active = YES;
    } if(alignment == 1) {
        //Center
      self.speculumStackView.alignment = UIStackViewAlignmentCenter;
      [self.speculumStackView.centerXAnchor constraintEqualToAnchor:self.centerXAnchor].active = YES;
    } if(alignment == 2) {
        //Right
      self.speculumStackView.alignment = UIStackViewAlignmentTrailing;
      [self.speculumStackView.rightAnchor constraintEqualToAnchor:self.rightAnchor].active = YES;
}if(alignment == 3) {
//bottom Anchor 
self.speculumStackView.alignment = UIStackViewAlignmentTrailing;
[self.speculumStackView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor].active = YES;
}

enter image description here

0 个答案:

没有答案