gpt4 book ai didi

objective-c - 显示 "screenshot flash"作为对用户的反馈

转载 作者:可可西里 更新时间:2023-11-01 05:14:18 26 4
gpt4 key购买 nike

我是 Objective-C 的新手,刚刚从头开始制作我的第一个应用程序。这是一个拼写应用程序,如果用户输入了错误的字母,我想显示屏幕上显示的相同白色闪光灯。我该怎么做?

最佳答案

// Create a empty view with the color white.

UIView *flashView = [[UIView alloc] initWithFrame:window.bounds];
flashView.backgroundColor = [UIColor whiteColor];
flashView.alpha = 1.0;

// Add the flash view to the window

[window addSubview:flashView];

// Fade it out and remove after animation.

[UIView animateWithDuration:0.05 animations:^{ flashView.alpha = 0.0; } completion:^(BOOL finished) { [flashView removeFromSuperview]; } ];

关于objective-c - 显示 "screenshot flash"作为对用户的反馈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12819544/

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