vendredi 30 janvier 2015

how to change the position of image inside cell of uitableview

I have added an image to the cell of a uitableview, but when I tried to change the position of the image nothing happened.


This is what my tableview function looks like:



override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell

let article = articles[indexPath.row] as Article

cell.textLabel!.text = article.title

cell.imageView?.image = article.image
let rect = CGRect(x: 0, y: 0, width: 100, height: 100)
cell.imageView?.frame = rect

return cell
}


As you can see the image shows up but the position stays the same:



Any ideas why this happens?




Aucun commentaire:

Enregistrer un commentaire