Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 设置self.view.window.frame更改动画_Iphone_Ios_Xcode_Cocoa Touch - Fatal编程技术网

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);
}];

它不起作用。我想要的是覆盖状态栏。只有换成窗框才行!