0
UIView *timerBarView = [[UIView alloc] initWithFrame:timerRect];
timerBarView.backgroundColor = [UIColor blueColor];
timerBarView.alpha = 0.5;
[theParentView addSubview:timerBarView];
[UIView animateWithDuration:duration
delay:0.0
options:UIViewAnimationOptionCurveLinear
animations:^{ timerBarView.transform = CGAffineTransformMakeScale(0, 1); }
completion:^(BOOL fin){if(fin)[timerBarView removeFromSuperview];}];
我敢肯定,这段代码工作,直到我更新到Xcode 6.现在timerBar根本不出现。所需的外观是一条长长的蓝色条,水平缩小到零。UIView和动画不出现
予记录的rects(之前立即上面的代码的执行)和那些似乎细:
timerRect: {{10, 252}, {362, 4}}
theParentView.bounds: {{0, 0}, {382, 258}}
我甚至尝试给予timerBarView一个100,100,200,50矩形,并直接将其添加到视图控制器的视图,而不是用它作为子视图。它仍然没有工作。
那么...我的timerBar在哪里? (; _;)
非常感谢。这正是问题所在! – user3925713 2014-11-04 22:21:53