[英]hide and show button with animation,iphone
隐藏或显示我正在使用的视图中的按钮
myButton.hide = YES or myButton.hide = NO
我正在寻找一种动画显示按钮的方式,比如慢慢淡入
有人知道怎么做,请帮忙
谢谢
您可以使用UIView
动画。 这是简单的实现:
// to hide
[UIView animateWithDuration:0.5
delay:1.0
options: UIViewAnimationCurveEaseOut
animations:^{
myButton.alpha = 0.0
}
completion:^(BOOL finished){
NSLog(@"Done!");
}];
// to show (implement in another method)
[UIView animateWithDuration:0.5
delay:1.0
options: UIViewAnimationCurveEaseOut
animations:^{
myButton.alpha = 1.0;
}
completion:^(BOOL finished){
NSLog(@"Done!");
}];
这是一个很好的教程: 如何使用UIView动画教程
您可能也想查看文档: UIView类参考
此网站中也有类似的QA:例如, 我如何为UIButton Alpha属性设置动画
希望能帮助到你!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.