iOS開發中一些公用的標頭檔

來源:互聯網
上載者:User

標籤:

轉自: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開發中一些公用的標頭檔

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.