我試圖在放置在UITableViewCell中的KDCircularProgress中設置一個圖像。未在KDCircularProgress中以編程方式設置圖像
當我從故事板中添加圖像成功地顯示,但是當我嘗試添加它編程的圖像不會出現。
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cellToReturn: DashBoardCell! = tableView .dequeueReusableCellWithIdentifier("DashBoardCell") as? DashBoardCell
if (cellToReturn == nil) {
cellToReturn = DashBoardCell(style: UITableViewCellStyle.Default, reuseIdentifier:"DashBoardCell")
}
let image: UIImage = UIImage(named: "ImageName")!
dImage = UIImageView(image: image)
dImage!.frame = CGRectMake(0,0,30,25)
dImage?.contentMode = UIViewContentMode.ScaleToFill
cellToReturn.dynamicImageView = dImage
dynamicImageView是在UITableViewCell類,所述的UIImageView出口,我試圖設置在表視圖細胞的動態圖像中,其中所述的TableView委託方法被實現的視圖控制器類。
我在做什麼錯?
謝謝!你的第一個解決方案奏效 –