各情報の取得方法

画面サイズの取得

CGRect rect = [[UIScreen mainScreen] bounds] ;
NSLog(@"bounds %@",NSStringFromCGRect(rect)) ;

3GSで実行すると以下のような結果になります。

bounds {{0, 0}, {320, 480}}

ステータスバーを除いた画面サイズの取得

CGRect rect = [[UIScreen mainScreen] applicationFrame] ;
NSLog(@"applicationFrame %@",NSStringFromCGRect(rect)) ;

3GSで実行すると以下のような結果になります。

applicationFrame {{0, 20}, {320, 460}}
iphone/system.txt · 最終更新: 2018/03/18 09:56 (外部編集)
 
特に明示されていない限り、本Wikiの内容は次のライセンスに従います: CC Attribution-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki