I am adding a UIDatepicker to a UIViewController, which is the rootview of a UINavigationController, and I use this code to position the Datepicker at the bottom of the screen.
UIDatePicker *picker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 216, 320, 216)];
[self.view addSubview:picker];
This should normally place the picker exactly at the bottom of the screen, but it is 44p missplaced. The Navigationbar is exactly 44p heigh, so I think this is the problem, but I don't know why the frame height includes the height of the navbar, when it doesn't act like a Subview.
I know a simple way would be to substract 44, but I am looking for a solution without any fixed numbers. Is there a way to implement it and can someone please explain me why the view includes the height of the navbar?