Xcode 4.5 background image iPhone 4, 4s, 5

后端 未结 3 2044
轻奢々
轻奢々 2021-02-04 18:29

I have in my viewController.m written the background code:

self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@\"image.png\"]];
         


        
3条回答
  •  野性不改
    2021-02-04 19:27

    I believe it is incorrect to assume that you can apply the -568h@2x trick to all image files. I think it only works for Default-568h@2x.png. This is the file that iOS looks for at app launch on a 4" display device, as well as the "flag" to enable 4" display support in the SDK. For example, once you include this specific file, your table views will fill the screen.

    I have not read anything to suggest that you can simply provide any image with the -568h@2x file name component and have it be used automagically. You'll have to do that yourself based on the screen size, e.g. [UIScreen mainScreen].bounds.size.height.

提交回复
热议问题