1
나는 응용 프로그램이 시작될 때 암호를 묻는 메시지를 표시하기 위해 UIAlert
을 가지고 있지만 암호가 필요할 때 viewcontroller에서 콘텐츠를 숨기려고합니다. 특히 applicationDidBecomeActive
인 경우. 쉬운 방법이 있나요?암호를 사용하여 내용을 숨기는 방법 UIAlert? Xcode
미리 감사드립니다.
나는 응용 프로그램이 시작될 때 암호를 묻는 메시지를 표시하기 위해 UIAlert
을 가지고 있지만 암호가 필요할 때 viewcontroller에서 콘텐츠를 숨기려고합니다. 특히 applicationDidBecomeActive
인 경우. 쉬운 방법이 있나요?암호를 사용하여 내용을 숨기는 방법 UIAlert? Xcode
미리 감사드립니다.
UIImageView 또는 간단한 UILabel과 같은 개체를 맨 위에 올려 놓고 비밀번호가 필요할 때 알파로 설정하면됩니다. 더 나은 사용자 경험을 위해 페이드 인/아웃 효과를 위해 UIAnimation을 적용하는 것을 고려할 수도 있습니다.
-(void)setupLabelForContentHiding{
CGRect rect = labelEmpty.frame; //UILabel
rect.origin.y = 0;
rect.origin.x = 0;
rect.size.width = self.view.frame.size.width;
rect.size.height = self.view.frame.size.height;
labelEmpty.frame = rect;
labelEmpty.alpha=0.0;
}
-(IBAction) hideContent:(id)sender{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.25];
[UIView setAnimationDelay:0.0];
labelEmpty.alpha = 1.0;
[UIView commitAnimations];
}