Setting UIButton image results in blue button in iOS 7

后端 未结 15 1821
[愿得一人]
[愿得一人] 2020-11-28 20:52

On iOS 6 SDK I wrote the following lines of code to display an image inside a button:

NSURL *thumbURL2 = [NSURL URLWithString:@\"http://example.com/thumbs/2.         


        
15条回答
  •  南笙
    南笙 (楼主)
    2020-11-28 21:03

    I had the same issue. On my storyboard I had a button without any image.

    I would then assign the image in the code.

    IOS 7 came and I got a lot of blue images.

    The resolution was simple yet confusing. If I assign any image on the storyboard and then change the image at run time it works fine.

    You always must specify a starting image on the storyboard even if you are not going to use it.

提交回复
热议问题