Bil*_*fas 6 ios swift apple-watch watchkit watchos-2
我只是想在我的WKInterfaceController中添加一个图像但是......
Xcode告诉我:
无法在Watch上找到名为"circle44"的图片
@IBOutlet var cirlceImage: WKInterfaceImage!
override func awakeWithContext(context: AnyObject?) {
super.awakeWithContext(context)
cirlceImage.setImageNamed("circle44")
}
Run Code Online (Sandbox Code Playgroud)
好吧,我发现结果图像必须在你的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()
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
883 次 |
| 最近记录: |