I'm using XCode 4 and I just created a subclass of UIViewController, status bar enabled (grey), and dropped in a MKMapView. My UIView has x,y and w,h of
(0,20) / (320,460)
Then I click on my MKMapView and it ha开发者_JAVA技巧s coordinates of:
(0,0) / (320, 460)
Is there a reason that IB doesn't resize itself so the MKMapView will take up the entire screen by making it (0,0)/(320, 480), or putting itself at (0,20)/(320,460)?
The picture below should identify my problem. Sorry if I am missing something super obvious. Thanks.
If you add any subview inside a view(container), then that container is the world for that subview, and it'll have co-ordinate according to that. That's why your map view have coordinate(0,0).
精彩评论