0
我試圖在一覽圖中顯示圖像。圖像格式爲.png,我已將其放入WatchKitApp軟件包中。Apple Watch:如何在圖像中顯示圖像
在一覽中,我在Glance中提供了默認組中的WKInterfaceImage。
下面是我的代碼來動態地找到它的圖像。
//
// GlanceController.swift
// Zappatap WatchKit Extension
//
// Created by Muhammad Umar on 4/5/15.
// Copyright (c) 2015 Zivato. All rights reserved.
//
import WatchKit
import Foundation
class GlanceController: WKInterfaceController {
@IBOutlet weak var glanceLable: WKInterfaceLabel!
@IBOutlet weak var glanceImage: WKInterfaceImage!
override func awakeWithContext(context: AnyObject?) {
super.awakeWithContext(context)
glanceLable.setText("This is new Glance")
glanceImage.setImage(UIImage(named: "[email protected]"))
// Configure interface objects here.
}
override func willActivate() {
// This method is called when watch view controller is about to be visible to user
super.willActivate()
}
override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
}
}
任何人都可以幫忙嗎?
你有沒有想過這一個?我有同樣的問題。該圖像出現在Storyboard中,但不在實際的Watch上。 – bkwebhero 2015-09-29 14:09:04