My application has a tab bar, and in one tab I have a navigation controller.
I want to find the position of the center of the view that appears between the navigation bar and tab bar, so that I can display a UIActivityIndicatorView right in the middle of the view when stuff happens.
However, I’m getting different values of self.view.bounds.size depending on where I am in the navigation hierarchy. At the top level, it tells me 320×460 but it’s 320×367 in deeper levels.
320×367 is the size I’m expecting (and confirmed in IB by the size inspector). So why am I seeing different on the top level only?
Answering own question by approaching the original problem a different way.
I was trying to create a UIActivityIndicator using initWithFrame, passing it coordinates for the center of the current view, calculated from its bounds.
However, this is unnecessarily complicated. I can simply set
to align the activity indicator right in the middle of the main view.