但什么viewOggetto究竟是什么?如果它是一个UIView,那么为什么要调用viewOggetto.view?
是一个UIViewController? 您通话双方:
[viewOggetto setFrame:aFrame];
[viewOggetto.view setFrame:aFrame];
假设它是一个UIViewController,试试这个/ PROVA COSI':
[self.view addSubview:viewOggetto.view]; // you need to have it before to animate it
// initial state of the animation:
[viewOggetto.view setFrame:CGRectMake(160, 240, 1, 1)]; // zoom from center
// viewOggetto.view.alpha = 0; // eventually to add a fadeIn animation
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
// ending state of animation:
// viewOggetto.view.alpha = 1; // restore to 1 to eventually to add a fadeIn animation
[viewOggetto.view setFrame:CGRectMake(0, 0, 320, 480)];
[UIView commitAnimations];
,如果它是一个UIView只是删除 “.view” 在每一个 “viewOggetto.view” 代码
ciao, luca
'aFrame'是一种我不熟悉的方法。你确定你不是指'[viewOggetto setFrame:aFrame];'? –
Oggetto是意大利人吧?你不认为为你的变量设置英文名称而不是混合英语和意大利语会很好吗? –
你对你的第一条评论是正确的,我的意思是[viewOggetto setFrame:aFrame];也是的,Oggetto是一个意大利名字,但它是我正在使用的上下文所必需的。 – Lorenzo