Using CGRECTMAKE what is the ratio to convert an iPhone 4 ..rect to an iphone 4s rect Xcode

StackOverflow https://stackoverflow.com/questions/17504140

質問

I have used CGRECTMAKE to position an image onto the 'camera' screen and was wondering whether there is a calculation ratio to convert a 4 image placement to a 4s

Iphone 4 screen is 320 480 iphone 4s screen is 640 960

I have tried just doubling my values but that doesnt seem to work so thought someone may know a formula to convert them

I cannot use AUTOLAYOUT or PLACE IMAGES ON SCREEN in storyboard as i am placing an image onto the camera screen..have tried these but no joy

thanks in advance

役に立ちましたか?

解決

Not sure if I get your question correct but CGrectMake utilizes points, not pixels. Since the screen on i4 has the same size as the screen on i4s, There should be no implementation differences.

You should use 320*480 measures. The screen is devided into 320*480 points for i4/i4s

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top