Iphone 设置self.view.window.frame更改动画
我正在使用块的动画,并尝试对主窗口的帧进行动画更改。 这是我的密码:Iphone 设置self.view.window.frame更改动画,iphone,ios,xcode,cocoa-touch,Iphone,Ios,Xcode,Cocoa Touch,我正在使用块的动画,并尝试对主窗口的帧进行动画更改。 这是我的密码: [UIView animateWithDuration:0.3f animations:^{ [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; self.view.window.frame = CGRectMake(0.0f, -20.0f, self.view.window.frame.size.width, s
[UIView animateWithDuration:0.3f animations:^{
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
self.view.window.frame = CGRectMake(0.0f, -20.0f, self.view.window.frame.size.width, self.view.window.frame.size.height+20);
}];
但是,它不像self.view.frame changing或其他东西那样设置动画。没有动画片,简直是一派胡言
有什么想法吗?这是错误的,窗口是固定在框架和边界上的, 您不能移动窗口,它的顶部根容器,并且具有恒定的大小,您应该像这样平移和变换视图
[UIView animateWithDuration:0.3f animations:^{
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
self.view.frame = CGRectMake(0.0f, -20.0f, self.view.frame.size.width, self.view.frame.size.height+20);
}];
它不起作用。我想要的是覆盖状态栏。只有换成窗框才行!