我有一个Button Add。这将添加来自画廊和相机的图像。
我想从ryt角显示这个UIVIew,它将从1扩展到2到3,并像气球一样扩展到最终状态4。它也会隐藏起来,从4到3再到2到1。
我已经使用了这个动画,但这不是我想要的(气球弹出)
/*[UIView beginAnimations:@"" context:NULL];
//The new frame size
[AddImagesToCanvasView setFrame: CGRectMake(224,185,175,132)];
//The animation duration
[UIView setAnimationDuration:2.0];
[UIView setAnimationDelay: UIViewAnimationCurveEaseIn];
[UIView commitAnimations];*/
发布于 2012-11-22 07:42:15
只需改变你想要的边框和半径即可..如果你想像气球一样显示图片,也可以在背景中添加图片,参见代码。
UIView *popUpView = [[UIView alloc] initWithFrame:view1.frame]; ///add the frame with requirement e.g view1,view2
popUpView.alpha = 0.0;
popUpView.layer.cornerRadius = 5;
popUpView.layer.borderWidth = 1.5f;
popUpView.layer.masksToBounds = YES;
[self.view addSubview:popUpView];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.4];
[popUpView setAlpha:1.0];
[UIView commitAnimations];
[UIView setAnimationDuration:0.0];
更新:
也可以通过下面的链接查看自定义的弹出视图。
我希望这能帮到你...
https://stackoverflow.com/questions/13507818
复制相似问题