2012-10-07 3 views

답변

0

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]; 
} 
관련 문제