title: Positioning UIDatePicker
body: <p>Part of my UIDatePicker is extending off the bottom of the screen even though I think I am positioning it correctly. Can someone tell me what I am doing wrong? I've gone through the following lines multiple tines and can't figure out where I went wrong. I'm trying to avoid explicitly specifying coordinates for my UIDatePicker's frame. I've included the relevant code from my view controller here:</p>
  
  <pre><code>// Create the time picker
  self.timePicker = [[UIDatePicker alloc] init];
  [self.timePicker addTarget:self action:@selector(datePickerDateChanged:) forControlEvents:UIControlEventValueChanged];
  self.timePicker.datePickerMode = UIDatePickerModeTime;
  
  // Set the time picker frame
  CGRect screenRect = [self.view frame];
  CGSize pickerSize = [self.timePicker sizeThatFits:CGSizeZero];
  CGRect pickerRect = CGRectMake(screenRect.origin.x,
                                 screenRect.origin.y + screenRect.size.height - pickerSize.height,
                                 pickerSize.width,
                                 pickerSize.height);
  NSLog(@"Picker frame: %f", screenRect.size.height);
  NSLog(@"Picker frame: %f", screenRect.origin.y + screenRect.size.height - pickerSize.height);
  [self.timePicker setFrame:pickerRect];
  
  // Add the picker to the view
  [self.view addSubview:self.timePicker];
  </code></pre>