繁体   English   中英

如何自定义UIAlert View ..?

[英]How to customize UIAlert View..?

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

在此输入图像描述

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

您可以设计自定义视图,并可以使用此代码将动画作为警报视图提供给它

    -(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。

关于这个话题以前的许多问题 ,其中的一个链接此组件 ,可以让你创建自定义提醒和动作片。 可能是一个好的开始方式。

您可以创建自己的自定义警报视图,除非用户交互,否则Apple不会拒绝它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM