In iphone development, it is sometimes necessary to get the status bar and navigation bar height and width information to facilitate layout of other controls. Here's how to get this information:
1 //status bar (StatusBar)2CGRect Rectstatus =[[UIApplication sharedapplication] statusbarframe];3NSLog (@"Status width-%f", rectStatus.size.width);//width4NSLog (@"Status height-%f", rectStatus.size.height);//Height5 6 //navigation Bar (Navigationbar)7CGRect Rectnav =Self.navigationController.navigationBar.frame;8NSLog (@"nav Width-%f", rectNav.size.width);//width9NSLog (@"nav height-%f", rectNav.size.height);//Height
In iphone development, it is sometimes necessary to get the status bar and navigation bar height and width information to facilitate layout of other controls. Here's how to get this information:
1 .- .- A One: $:47.364alpay[3736:140176] UnknownclassViewcontrollerinchInterface Builder file.2 .- .- A One: $:47.426alpay[3736:140176] Status Width-414.0000003 .- .- A One: $:47.427alpay[3736:140176] Status Height-20.0000004 .- .- A One: $:47.427alpay[3736:140176] Nav Width-414.0000005 .- .- A One: $:47.427alpay[3736:140176] Nav Height-44.000000
iOS get status bar and navigation bar size (width and height)