UIScreen bounds versus applicationFrame

前端 未结 2 419
失恋的感觉
失恋的感觉 2020-12-28 20:30

Why do I see in some sample code from Apple (such as PhotoScroller) that I should do the following in loadView:

CGRect frame = [[UIScreen mainSc         


        
2条回答
  •  一生所求
    2020-12-28 20:46

    ApplicationFrame is the screen size minus the size of the status bar (if visible), bounds is the screen size regardless of status bar.

    So applicationFrame would return CGRectMake(0,0,320,460) assuming your app has the status bar set to be visible, while bounds would return CGRectMake(0,0,320,480) under the same conditions. Those numbers are assuming iPhone/iPod Touch screen sizes.

    UIScreen Class Reference

提交回复
热议问题