IPhone/IPad: How to get screen width programmatically?

前端 未结 7 551
囚心锁ツ
囚心锁ツ 2020-11-29 00:36

Hi I\'m wondering if there\'s a way to get the width programmatically.

I\'m looking for something general enough to accomodate iphone 3gs, iphone 4, ipad. Also, the

7条回答
  •  再見小時候
    2020-11-29 01:13

    Use this code it will help

    [[UIScreen mainScreen] bounds].size.height
    [[UIScreen mainScreen] bounds].size.width
    

提交回复
热议问题