gpt4 book ai didi

iphone - 如何自定义 UIAlert View..?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:43:13 27 4
gpt4 key购买 nike

我通过添加图像自定义了 UIViews,使其看起来像单选按钮或复选框,但对于我的规范,我想让 UIAlertView 看起来像这样。 ..

enter image description here

任何人都可以建议如何做到这一点?谢谢!

最佳答案

您可以设计自定义 View ,并可以使用此代码为其提供动画作为警报 View

    -(void)initialDelayEnded 
{

alert_upload.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.001, 0.001);
alert_upload.alpha = 1.0;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1/1.5];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(bounce1AnimationStopped)];
alert_upload.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.1, 1.1);
[UIView commitAnimations];
}

- (void)bounce1AnimationStopped {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.5/2];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(bounce2AnimationStopped)];
alert_upload.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.9, 0.9);
[UIView commitAnimations];
}

- (void)bounce2AnimationStopped {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.5/2];
alert_upload.transform = CGAffineTransformIdentity;
[UIView commitAnimations];


}

alert_upload 是 UIView。

关于iphone - 如何自定义 UIAlert View..?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14704817/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com