views:

35

answers:

1

One of my tab bar's items is UIViewController representing UIScrollView. Once the scroll view is created I need to setContentSize, but I don't know how to calculate size from its controller, considering tab bar area. I would consider to avoid hard coding.

A: 

Look at the frame of your tab bar controller, and your UIScreen applicationFrame do some math. The difference in the subtraction will be how much space you have to work with.

jer
does UIScreen consider top system bar?
Michael
If you look at the UISystem documentation, you'll note that the applicationFrame property explicitly notes that it's the area minus the status bar. Therefore, you don't have to worry about the status bar being 20 pixels today, and 100 tomorrow, your applicationFrame will be different if the size of the status bar changes in some future release.
jer