代码拉取完成,页面将自动刷新
同步操作将从 HENG CHENGFEI/CFCenterItemViews 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
To run the example project, clone the repo, and run pod install
from the Example directory first.
let topItems = ["home_top_0":"你的优选",
"home_top_1":"专属推荐",
"home_top_2":"下午茶",
"home_top_3":"商家活动"].sorted(by: {return $0.0 < $1.0})
override func viewDidLoad() {
super.viewDidLoad()
self.title = "平均分布"
var items:[CFCenterItemView] = []
let itemViews = CFCenterItemViews(frame: CGRect(x: 0, y: 0, width: containerView.frame.size.width, height: containerView.frame.size.height))
itemViews.touchHandler = { index in
print(index)
}
for (key,value) in topItems {
let itemView = CFCenterItemView(frame: CGRect(x: 0, y: 0, width: 0, height: itemViews.frame.size.height))
itemView.backgroundColor = UIColor.white
let imageView = UIImageView(image: UIImage(named: key))
let label = UILabel()
label.text = value
label.font = UIFont.systemFont(ofSize: 15)
label.textColor = UIColor.black
itemView.setup(imageView: imageView, label: label, gap:10.0)
items.append(itemView)
}
itemViews.setup(items: items)
containerView.addSubview(itemViews)
}
CFCenterItemViews is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "CFCenterItemViews"
chengfei.heng, hengchengfei@sina.com
CFCenterItemViews is available under the MIT license. See the LICENSE file for more info.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。