你好,歡迎來到IOS教程網

 Ios教程網 >> IOS使用技巧 >> IOS技巧綜合 >> IOS中獲取屏幕尺寸

IOS中獲取屏幕尺寸

編輯:IOS技巧綜合
[摘要]本文是對IOS中獲取屏幕尺寸的講解,對學習IOS蘋果軟件開發有所幫助,與大家分享。

//app尺寸,去掉狀態欄

CGRect appRect = [UIScreen mainScreen].applicationFrame;

NSLog(@"%f, %f, %f,%f",appRect.origin.x, appRect.origin.y, appRect.size.width,appRect.size.height);

//屏幕尺寸

CGRect screenRect = [UIScreen mainScreen].bounds;

NSLog(@"%f, %f, %f,%f",screenRect.origin.x, screenRect.origin.y, screenRect.size.width,screenRect.size.height);

//裝天欄尺寸

CGRect statusRect = [[UIApplication sharedApplication] statusBarFrame];

NSLog(@"%f, %f, %f,%f",statusRect.origin.x, statusRect.origin.y, statusRect.size.width,statusRect.size.height);

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved