Transferred from: http://my.oschina.net/u/1025290/blog/300037
#ifndef ui_definitions#defineUi_definitions#pragmaMark UI-related constants//Navigation Bar Height#defineContent_navigationbar_height 44//Bottom Tabbar Height#defineContent_tabbar_height 49//the height of the keyboard in the English state#defineEngish_keyboard_height 216//Screen Width#defineScreen_width ([[UIScreen mainscreen]bounds].size.width)//Screen Height#defineScreen_height ([[UIScreen mainscreen]bounds].size.height)//Search Box Frame#defineSearch_bar_frame CGRectMake (0,0,screen_width, 44)//iPhone StatusBar Height#definePhone_statusbar_height 20//iPhone screen size, removed status bar height#definePhone_screen_size (Cgsizemake (Screen_width, Screen_height-phone_statusbar_height))//determine if the iphone is a 4-inch screen#defineis_iphone_568 ([[Uidevice currentdevice] userinterfaceidiom] = = Uiuserinterfaceidiomphone && [UIScreen Mainscreen].bounds.size.height = = 568)//suitable for 3.5 inch screen and 4 inch picture name#defineAdapt_image_name (ImageName) (is_iphone_568?) [NSString stringwithformat:@ "%@-568h", [ImageName Stringbydeletingpathextension]]:imagename)//Bold Font#defineBoldlabelfont (fontSize) [Uifont boldsystemfontofsize:fontsize]//Normal Font#defineLabelfont (fontSize) [Uifont systemfontofsize:fontsize]//Add a picture to the bundle file#defineGet_image_from_bundle_path (imagename,bundlename) [Resbundleutils imagenamedfromimagesbundlepng:imagename Withsubpath:bundlename]#endif
Define Code
Some common header files in iOS development