我确定这是一个快速修复或有一些设置,但由于某种原因,我无法在任何地方找到答案。
我在屏幕上的 UIImageView 始终排列在状态栏上方,即使我将其发送到后面,如图所示。
如何始终将状态栏保持在顶部?我将通过顶部边缘将图像从屏幕上向上滑动,因此我希望它们保持在栏下方。
这是我的一些代码,我在其中生成图像并将其移出屏幕顶部:
UIImage *towerBG = [UIImage imageNamed:@"towerbg.png"];
UIImageView *towerBGView = [[UIImageView alloc] initWithImage:towerBG];
towerBGView.frame = CGRectMake(0, 150, towerBGView.frame.size.width, towerBGView.frame.size.height);
[self.view addSubview:towerBGView];
[self.view sendSubviewToBack:towerBGView];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
towerBGView.frame = CGRectMake(0, -300, towerBGView.frame.size.width, towerBGView.frame.size.height);
[UIView commitAnimations];