title: Handling rotation UIView programmatically
body: <p>At the very first start-up, the App handles a housekeeping of a database. it takes a while an, therefore, I'added a translucentview with a spinner and a label telling the user what's going on.</p>
  
  <p>In order to have this translucent view on top of everything else, I've added as a subview of self.view.window. The whole code looks like this:</p>
  
  <pre><code>-(void)housekeepDataBase{
  
      self.searchOptionsControl.hidden=TRUE;
      self.searchBar.hidden=TRUE;
  
      UIView *translucentView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.window.frame.size.width, self.view.window.frame.size.height)];
      translucentView.backgroundColor=[UIColor blackColor];
      translucentView.alpha=0.65;
  
  
      UILabel *activityLabel=[[UILabel alloc]initWithFrame:CGRectMake((self.view.center.x-140), (self.view.frame.size.width*0.75), 280, 20)];
      activityLabel.numberOfLines=1;
      activityLabel.textAlignment=UITextAlignmentCenter;
      activityLabel.font=[UIFont fontWithName:@"Arial" size:20.0];
      activityLabel.text=@"Cleaning up database";
      activityLabel.textColor=[UIColor whiteColor];
      activityLabel.backgroundColor=[UIColor clearColor];
  
  
      UILabel *activityLabel2=[[UILabel alloc]initWithFrame:CGRectMake((self.view.center.x-140), (self.view.frame.size.width*0.75+40), 280, 20)];    activityLabel2.numberOfLines=1;
      activityLabel2.textAlignment=UITextAlignmentCenter;
      activityLabel2.font=[UIFont fontWithName:@"Arial" size:16.0];
      activityLabel2.text=@"(It might take a while)";
      activityLabel2.textColor=[UIColor whiteColor];
      activityLabel2.backgroundColor=[UIColor clearColor];
  
  
  
      UIActivityIndicatorView *spinner=[[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
      spinner.frame=CGRectMake((self.view.center.x-50), (self.view.frame.size.width*0.50), 100, 37);
      [spinner startAnimating];
  
  
      [self.view.window addSubview:translucentView];
      [self.view.window addSubview:spinner];
      [self.view.window addSubview:activityLabel];
      [self.view.window addSubview:activityLabel2];
  
  // dealing with the DB
  
  }
  </code></pre>
  
  <p>Unfortunatelly it causes these views (view, spinner and labels) not to rotate according to the device orientation.</p>
  
  <p>So, the question is: is there any other way to handle this? either the rotation or adding the views?
  What I want is to have the translucent view to be on top of the navigationbar at the top of the screen and also on top of the toolbar at the bottom.</p>
  
  <p>Any ideas?  Thanks in advance!</p>