How can I programmatically set my WatchKit App background image? I need to set this in code as it changes depending on variable size and we need to place a label over the image.
Create a photo watch faceYou can also create a Kaleidoscope watch face based on the photo, or add a new Photos watch face in the Apple Watch app on your iPhone. See Customize the watch face. , swipe up, tap Create Watch Face, then choose to create a Portraits, Photos, or Kaleidoscope watch face.
To begin, open the Photos app on your iPhone and select the "Recents" albums. Tap on the photo you want as your Apple Watch wallpaper, and then tap on the heart icon at the bottom to flag it as a "Favorite." By default, your Apple Watch syncs photos from your Favorites.
It is not possible to programatically set the background image on an entire Watch App page in WatchKit... a background image for the whole page can at the current time only be set in Interface Builder it appears.
However, you can set a picture as a background behind a label, and make that image fill the screen:
This group image can also be set programmatically:
Set the background image in the awakeWithContext
method of the Extension (assuming you called your IBOutlet 'group'):
[self.group setBackgroundImage:[UIImage imageNamed:@"myImageName.png"]];
The two techniques are of course not mutually independent. You can set an initial image in Interface Builder, and then replace it programatically later if that is called for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With