我只是想在我的WKInterfaceController中添加一个图像但是……
Xcode告诉我:
Unable to find image named “circle44” on Watch
@IBOutlet var cirlceImage: WKInterfaceImage!
override func awakeWithContext(context: AnyObject?) {
super.awakeWithContext(context)
cirlceImage.setimageNamed("circle44")
}
解决方法
好吧,我发现结果图像必须在你的WatchKt应用程序中,而不是你的扩展程序.随着应用程序变薄的增加,手表不再搜索1x图像,因为它们都应该是2x.
import WatchKit
import Foundation
class InterfaceController: WKInterfaceController {
@IBOutlet var cirlceImage: WKInterfaceImage!
override func awakeWithContext(context: AnyObject?) {
super.awakeWithContext(context)
cirlceImage.setimageNamed("circle94")
}
override func willActivate() {
super.willActivate()
}
override func didDeactivate() {
super.didDeactivate()
}
}