iPhone 动画视图叠加
我有一些 XIB 是我的页面,我使用presentmodalviewcontroller 通过一些按钮在它们之间切换。现在我想使用其他按钮来拉出这些视图上的叠加层。我现在的情况是我有一个按钮,可以简单地切换 UIImageview 上的“隐藏”属性。
用于动画显示/隐藏功能的选项有哪些?当调用叠加层时,我想要某种放大或缩小效果,而不是突然显示/隐藏。
-(IBAction)basketballbutton{
if (basketball.hidden == YES)
basketball.hidden = NO;
else if (basketball.hidden == NO)
basketball.hidden = YES;
谢谢!
I have a few XIBs that are my pages, and i'm using presentmodalviewcontroller to switch between them with some buttons. Now I want to use other buttons to pull up overlays on those views. How I have it now is I have a button which simply toggles the "Hidden" property on the UIImageview.
What are options for animating the show/hide functionality of this? I'd like some sort of zoom-in or zoom-out effect when the overlay is called up rather than just suddenly showing/hiding.
-(IBAction)basketballbutton{
if (basketball.hidden == YES)
basketball.hidden = NO;
else if (basketball.hidden == NO)
basketball.hidden = YES;
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 alpha 属性设置视图不透明度的动画。
这将为视图的显示和隐藏设置动画。
以下是设置缩放变换的方法:
You can animate the view opacity using the alpha property.
This will animate the showing and hiding of the view.
Here is how you set the transform for scaling: