2011-09-30 4 views
1

화면의 특정 칸에 초점을 맞추면 메시지를 표시해야하며 자동으로 숨길 필요가 있습니다. alertview가 융통성있게 또는 다른 방법으로 제공 될지 여부는 iPhone 및 iPad에있는 것들을 구현할 것입니다.사용자 상호 작용없이 자동으로 숨기기 위해 UIAlertView를 만드는 방법은 무엇입니까?

[[NSTimer scheduledTimerWithTimeInterval:2 
           target:self 
           selector:@selector(closeAlert:) 
           userInfo:nil 
           repeats:NO] retain]; 

자세한 내용은 이쪽을 봐 :

+0

여기 아무도 당신을 위해하지 않습니다. 당신이 한 일을 보여 주면 도움을받을 수 있습니다. – LightNight

답변

0

당신은 몇 초 동안 표시 한 후 경고를 해제 할 수 있습니다. 다음과 같은 메시지 : (5 초 후에 닫음)

UIAlertView *yourAlert = [[UIAlertView alloc]initWithTitle:@"title" message:@"message" delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; 
     [yourAlert show]; 
     [self performSelector:@selector(dismiss:) yourAlert afterDelay:5.0]; 



-(void)dismiss:(UIAlertView*)alert 
{ 
    [alert dismissWithClickedButtonIndex:0 animated:YES]; 
} 
관련 문제