###[Swift]リスト表示で、先頭に丸型の画像を表示させたいのですが。
Lineの一覧表示画面のように、丸型の画像を一覧の左に表示させたいのですが、
画像の変更方法がわかりません。
###四角い画像表示のサンプル(うまく行っている)
let url = "http://xxx.png" // URLから画像のURL if let image_data = try? Data(contentsOf: url!) { cell.imageView?.image = UIImage(data: image_data) }
###丸く画像表示しようとしたが上手く行かない
let url = "http://xxx.png" // URLから画像のURL if let image_data = try? Data(contentsOf: url!) { cell.imageView?.image = UIImage(data: image_data) cell.imageView?.layer.cornerRadius = 40 cell.imageView?.layer.masksToBounds = true }
###調べた事
Google swift 画像 丸
Google swift 画像 丸 マスク
にて、
http://qiita.com/t_punch/items/7199ef33d8f5cdca254f
http://qiita.com/arthur87/items/a1aa46e9f498d85d6546
http://ryutamaki.hatenablog.com/entry/2014/01/27/132020
http://blog.asobicocoro.com/entry/2016/06/20/234004
を、参考にしましたが、うまく行きませんでした。
回答1件
あなたの回答
tips
プレビュー