【发布时间】:2017-02-09 11:12:11
【问题描述】:
我在按钮中有一个 Uibutton。当用户单击该按钮时,会显示一个 uiview 动画,就像从按钮向上弹出一样。 这是我的代码
-(void)viewDidLoad
{
[super viewDidLoad];
self.BuyButtonPopUpView.frame = CGRectMake(self.BuyButtonPopUpView.frame.origin.x, 1000, self.BuyButtonPopUpView.frame.size.width,self.BuyButtonPopUpView.frame.size.height);
}
- (IBAction)animated:(id)sender
{
if(_isAnimated)
{
[UIView animateWithDuration:0.3
delay:0.0
options: UIViewAnimationOptionCurveEaseIn
animations:^{
self.BuyButtonPopUpView.frame = CGRectMake(self.BuyButtonPopUpView.frame.origin.x, 520, self.BuyButtonPopUpView.frame.size.width,self.BuyButtonPopUpView.frame.size.height);
}
completion:^(BOOL finished){
}];
_isAnimated=NO;
}
else
{
[UIView animateWithDuration:0.3
delay:0.0
options: UIViewAnimationOptionCurveEaseIn
animations:^{
self.BuyButtonPopUpView.frame = CGRectMake(self.BuyButtonPopUpView.frame.origin.x, 1000, self.BuyButtonPopUpView.frame.size.width,self.BuyButtonPopUpView.frame.size.height);
}
completion:^(BOOL finished)
{
}];
_isAnimated=YES;
}
}
Uiview 动画完美运行,但是当 uiview 出现时,背景视图会像 uiactionsheet 一样创建阴影(或模糊),并且在完成动画后背景视图是清晰的。 我不知道如何实施。 请帮帮我 我是ios新手...
【问题讨论】:
-
相反,如果不需要动画,您可以使用两个已选中且正常的图像并相应更改
-
谢谢你的建议..
标签: ios objective-c uiview uiviewanimation