The key thing to understand about supporting the Retina Display is that, in your code, the screen is always 320x480. You don't need to double the resolution of anything but your image resources themselves. In this case, you just need to put two resources in your app bundle: an alert_bg.png
that fits on a 320x480 screen—in this case, I'd guess that'd be 286x88—and an [email protected]
, exactly double the size of the other, that fits on a 640x960 one. If you ask UIKit for [UIImage imageNamed:@"alert_bg"]
, it'll automatically pick the correct-resolution resource for the current screen.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…