我只想向我的 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 应用程序中而不是在您的扩展程序中。随着应用程序变薄的加入, watch 不再搜索 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()
}
}
关于ios - 观看 OS 2 问题以设置图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32281009/