uiimageview

Add a gradient on UIImageView

徘徊边缘 提交于 2020-07-28 13:04:26
问题 I am trying to add a sublayer on my UIImageView but it doesn't work. I have a set of 10 images named from photo0 to photo9 and I display it with a timer of 5s. The outlet shanghaiImage is my background I would like to add a gradient on top of this marty like: transparent (top) to black (bottom). Thanks for the help :) Here is my code in Swift 3. This part is fine : import UIKit class ViewController: UIViewController { @IBOutlet weak var shanghaiImage: UIImageView! // beginning index var

Add a gradient on UIImageView

落爺英雄遲暮 提交于 2020-07-28 13:04:22
问题 I am trying to add a sublayer on my UIImageView but it doesn't work. I have a set of 10 images named from photo0 to photo9 and I display it with a timer of 5s. The outlet shanghaiImage is my background I would like to add a gradient on top of this marty like: transparent (top) to black (bottom). Thanks for the help :) Here is my code in Swift 3. This part is fine : import UIKit class ViewController: UIViewController { @IBOutlet weak var shanghaiImage: UIImageView! // beginning index var