开发者

Defining constant for screen width

开发者 https://www.devze.com 2023-02-11 05:28 出处:网络
I ha开发者_如何学运维ve a constant defined with screen width to 320. This is being used at multiple places in my code. I have to change this to take value from current device and I do not want to touc

I ha开发者_如何学运维ve a constant defined with screen width to 320. This is being used at multiple places in my code. I have to change this to take value from current device and I do not want to touch all these places. So, I want to define a constant for this with value:

[[UIScreen mainScreen] bounds].size.width

#define kScreenWidth [[UIScreen mainScreen] bounds].size.width

But it is giving me lot of compilation errors. Any clue?


[[UIScreen mainScreen] applicationFrame].size.width
0

精彩评论

暂无评论...
验证码 换一张
取 消