Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.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
Objective c 如何将iOS元素组合在一起,以便它们可以作为单个元素进行操作_Objective C_Ios_Cocoa_Core Animation - Fatal编程技术网

Objective c 如何将iOS元素组合在一起,以便它们可以作为单个元素进行操作

Objective c 如何将iOS元素组合在一起,以便它们可以作为单个元素进行操作,objective-c,ios,cocoa,core-animation,Objective C,Ios,Cocoa,Core Animation,我的iOS应用程序中有3个UI元素,我希望在设置动画时将它们视为单个实体 有一个UIImageView,上面有一个UILabelView和UIActivityIndicatorView。有没有一种方法可以将这些东西组合在一起,并在不必单独设置每个对象的动画的情况下设置组的动画?是的,将它们放在容器中UIView(它将是他们的superview)并设置动画 UIView* containerView = // alloc-init [containerView addSubview:aSubvie

我的iOS应用程序中有3个UI元素,我希望在设置动画时将它们视为单个实体


有一个UIImageView,上面有一个UILabelView和UIActivityIndicatorView。有没有一种方法可以将这些东西组合在一起,并在不必单独设置每个对象的动画的情况下设置组的动画?

是的,将它们放在容器中
UIView
(它将是他们的
superview
)并设置动画

UIView* containerView = // alloc-init
[containerView addSubview:aSubview]; // repeat for the other views you have

是的,将它们放入容器
UIView
(它将是它们的
superview
)并设置动画

UIView* containerView = // alloc-init
[containerView addSubview:aSubview]; // repeat for the other views you have