標籤:
轉自:http://my.oschina.net/u/1025290/blog/300037
#ifndef UI_DEFINITIONS#define UI_DEFINITIONS#pragma mark UI相關常量//導覽列高度#define CONTENT_NAVIGATIONBAR_HEIGHT 44//底部tabbar 高度#define CONTENT_TABBAR_HEIGHT 49//英文狀態下鍵盤的高度#define ENGISH_KEYBOARD_HEIGHT 216//螢幕寬度#define SCREEN_WIDTH ([[UIScreen mainScreen]bounds].size.width)//螢幕高度#define SCREEN_HEIGHT ([[UIScreen mainScreen]bounds].size.height)//搜尋方塊frame#define SEARCH_BAR_FRAME CGRectMake(0,0,SCREEN_WIDTH, 44)//iPhone statusbar 高度#define PHONE_STATUSBAR_HEIGHT 20//iPhone 螢幕尺寸,已去掉status bar的高度#define PHONE_SCREEN_SIZE (CGSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT - PHONE_STATUSBAR_HEIGHT))//判斷是否為4寸屏iPhone#define IS_IPHONE_568 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568)//適配3.5寸屏和4寸品的圖片名#define ADAPT_IMAGE_NAME(imageName) (IS_IPHONE_568 ? [NSString stringWithFormat:@"%@-568h", [imageName stringByDeletingPathExtension]]:imageName)//加粗字型#define BOLDLABELFONT(fontSize) [UIFont boldSystemFontOfSize:fontSize]//普通字型#define LABELFONT(fontSize) [UIFont systemFontOfSize:fontSize]//將圖片加入bundle檔案#define GET_IMAGE_FROM_BUNDLE_PATH(imageName,bundleName) [ResBundleUtils imageNamedFromImagesBundlePNG:imageName withSubPath:bundleName]#endif
define code
iOS開發中一些公用的標頭檔