2012-10-07 40 views

回答

0

您可以通過將一個物體如的UIImageView或在頂部和設置甚至簡單的UILabel它的阿爾法至1.0需要輸入密碼時這樣做。你甚至可以考慮應用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]; 
}