// // HomeRecommendView.swift // ADHTuanCan // // Created by 敖德亨 on 2023/9/30. // import UIKit class HomeRecommendView: UIView { private var scrollView : UIScrollView! var dataModel : SupplyTypeListModel? var allBtns : [UIButton] = [] var runTypeAction : ((String?)->Void)? var btnW = (kSCREEN_WIDTH - 72)/3 override func awakeFromNib() { super.awakeFromNib() self.backgroundColor = kTBackgroundColor self.scrollView = UIScrollView.init(frame: CGRect.zero) self.scrollView.alwaysBounceHorizontal = true self.scrollView.isScrollEnabled = true self.scrollView.showsHorizontalScrollIndicator = false self.scrollView.contentInsetAdjustmentBehavior = .never self.scrollView.backgroundColor = UIColor.white self.addSubview(self.scrollView) self.scrollView.mas_remakeConstraints { make in make?.left.right().top().bottom().mas_equalTo()(self) make?.height.offset()(36 + 40) } } func configTitle(model : SupplyTypeListModel){ dataModel = model var views = scrollView.subviews views.removeAll() self.allBtns.removeAll() if let _ = model.runTypeList{ for i in 0..