user3344717
user3344717

Reputation: 161

Setting an image from a file in Today Widget

I'm having a strange issue where I cannot set a button image (or a UIImageView.image) programmatically. I can set the image in the storyboard, but if I try to change it, the app freezes up. Example. I have copied the image into the folder and can use that image to set the button in storyboard.

[self.picButton setImage:[UIImage imageNamed:@"myImage.png"] forState:UIControlStateNormal];

Upvotes: 0

Views: 831

Answers (1)

Shiv Raj
Shiv Raj

Reputation: 21

Make sure to add widget target for the images or other assets you want to use in the widget.

Upvotes: 2

Related Questions