Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.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 动画块无法调整UiView的大小,但可以移动它_Iphone_Ios - Fatal编程技术网

Iphone 动画块无法调整UiView的大小,但可以移动它

Iphone 动画块无法调整UiView的大小,但可以移动它,iphone,ios,Iphone,Ios,我的appdelegate窗口顶部有一个UIView。 当我试图调整它的大小使其消失时,动画不起作用 TLDR:无法使用UIAnimation块调整UIView的大小,但可以移动它 [UIView animateWithDuration:0.3 delay:0 options: UIViewAnimationCurveEaseIn animations:^{

我的appdelegate窗口顶部有一个UIView。 当我试图调整它的大小使其消失时,动画不起作用

TLDR:无法使用UIAnimation块调整UIView的大小,但可以移动它

[UIView animateWithDuration:0.3
                      delay:0
                    options: UIViewAnimationCurveEaseIn
                 animations:^{ 
                     CGRect frame = viewMore.frame;
                     frame.size.height = 0;
                     viewMore.frame = frame;

                 } 
                 completion:^(BOOL finished){

                 }];
但是,如果我想移动视图,使用这段代码,它就像魅力一样工作。 例如:

[UIView animateWithDuration:0.3
                      delay:0
                    options: UIViewAnimationCurveEaseIn
                 animations:^{ 
                    CGPoint centerMore =    viewMore.center;
                     centerMore.y += viewMore.frame.size.height;
                     viewMore.center = centerMore;


                 } 
                 completion:^(BOOL finished){


                 }];
viewMore有2个UIButton子视图。 同样的代码用于调整UIWebView的大小 有些事我不明白。 你是我唯一的希望(好吧,不,你不是:)

好吧, 问题是子视图(带图像的UIButton)没有调整大小。 解决方案: 将视图上的设置为“是”以调整大小