로그인 버튼과 가입 버튼을 호스팅하는 앱이 있습니다. 인터넷에 연결할 수없는 경우 reachability를 사용하여 해당 버튼을 숨김으로 표시합니다. 이 작업이 완료되면 내가, 내가 alertview을이보기의 알파와 함께 연주 몇 가지 간단한 애니메이션을 원하는가 이제보기UIView, animate, completionblock, UIAlertView
self.coveringview
을 포함하는이 코드에 일어날 어떤 사용자에게 팝업을 내가 뭐하는 거지 볼 수 있습니다 그것은 alert.with를 완료하여 animatewithduration의 완료 블록에 표시함으로써.
bahvior는 내가 원하는 것이 아니므로 사용자에게 표시 할 페이드 아웃을 표시하지 않고 경고 팝업이 너무 빠르게 나타납니다. 어떻게해야합니까?
NetworkStatus netStatus = [reachability currentReachabilityStatus];
if(netStatus == NotReachable) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"No Internet Connection"
message:@"Unable to connect to the server.
Please check your internet connection and try again."
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"OK", nil];
[UIView animateWithDuration:1.0
animations:^{
self.coveringView.alpha = 1.0;
}completion:^(BOOL finished) {
// this is the problem here, I need to make this alert show up after
the fade out occurs completely
[alert show];
self.coveringView.hidden = NO;
}];
}
else {
[UIView animateWithDuration:1.0
animations:^{
self.coveringView.alpha = 0.0;
}completion:^(BOOL finished) {
self.coveringView.hidden = YES;
}];
}
여전히 그 일을하지, 그것은 너무 빨리, 내가 여기 아마 멀티 스레딩에 문제가 있다고 생각 팝업 ?? – Eddie
나는 그런 식으로 시도한 대답을 편집했습니다. –
아직도 그것을하고 있지 않습니다. 나는 또 다른 지연이 필요하다고 생각합니다. – Eddie