-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
I try to customize my views inside horizontalScrollView, but the item only appear on once, not completely iterate. Look like this :
I used this code :
if indexPath.row == 0 {
horizontalScrollView.uniformItemSize = CGSize(width: 80, height: 60)
horizontalScrollView.setItemsMarginOnce()
for _ in 1...20{
let imageView = UIImageView(frame: CGRect.zero)
imageView.image = UIImage(named: "cetakidcard")
imageView.contentMode = .scaleAspectFill
let viewSome = UIView()
viewSome.backgroundColor = UIColor.black
let produkLabel = UILabel()
produkLabel.text = "Software Antrian"
let produkImage = UIImageView()
produkImage.image = UIImage(named: "cetakidcard")
produkImage.contentMode = .scaleAspectFill
produkImage.snp.makeConstraints { make in
make.height.equalTo(50)
make.width.equalTo(50)
}
viewSome.addSubview(produkImage)
horizontalScrollView.addItem(viewSome)
}
}
Metadata
Metadata
Assignees
Labels
No labels
