Commit e9da6f13 authored by pete谢兆麟's avatar pete谢兆麟

banner 默认

parent 8ae525a1
......@@ -118,13 +118,15 @@ extension YHServiceBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
public func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell {
let cell = pagerView.dequeueReusableCell(withReuseIdentifier: "cell", at: index)
let image = UIImage(named: "default_placeholder_image")?.bs_scaled(toWidth: UIDevice.kScreenW - 16*2, opaque: false)
cell.imageView?.image = image
if index < dataArr.count {
let model = dataArr[index]
if model.id != 0 {
if let url = URL(string: model.img_url) {
cell.imageView?.kf.setImage(with: url)
}
} else {
cell.imageView?.image = UIImage(named: model.img_url)
}
// cell.textLabel?.text = model.name
}
cell.imageView?.contentMode = .scaleAspectFill
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment