I’m adding a UIView subclass to a UITableViewController subclass like this:
[self.view addSubview:myUIView];
The dimensions of myUIView are width = 320 and height = 100. Assume I’m doing everything in portrait mode. When I set the frame of myUIView to CGRectMake(0, 480 - 100, 320, 100) the bottom of myUIView is cut off. How can I set the frame of myUIView such that it’s not cut off?
Update: The height of the cut-off portion is equal to the height of the status bar + the height of the navigation bar. I think the UIView is being added to a UIScrollView (the UITableViewController‘s view which is a UITableView which inherits UIScrollView) that’s scrolled down (a distance equal to the cut-off portion of the UIView).
Do you have a status/navigotion/tab bar? if so their height would need to be subtracted from the 480 px screen height. You could also make things easier for yourself by doing something like this