Closed slash130 closed 5 years ago
@slash130 莫慌,首先目前只开放了设置leading。
当然,你直接改LLCycleScrollViewCell.swift
文件,#106-setupTitleLabel
是可以的。
// Setup Title
fileprivate func setupTitleLabel() {
titleLabel = UILabel.init()
titleLabel.isHidden = true
titleLabel.textColor = titleLabelTextColor
titleLabel.numberOfLines = titleLines
titleLabel.font = titleFont
titleLabel.backgroundColor = UIColor.clear
titleLabel.textAlignment = .center
titleBackView.addSubview(titleLabel)
}
你确认下。
我就是这样添加的设置,然后在模拟器里运行没有效果,还是居左。
self.lbview.imagePaths = imagesURLStrings
self.lbview.titles = titles
self.lbview.autoScrollTimeInterval = 2.5
self.lbview.imageViewContentMode = .scaleToFill
if imagesURLStrings.count == 1 {
self.lbview.customPageControlStyle = .none
} else {
self.lbview.customPageControlStyle = .fill
}
self.lbview.pageControlPosition = .center
self.lbview.isAddingPercentEncodingForURLString = true
self.lbview.delegate = self
这是调用代码。
@slash130 我糗糗你的初始化代码,你也可以运行下我的Demo。
怪了,在你的demo里添加居中生效,在我的项目里修改pod里的代码不生效。
@slash130 pod 你确定是修改后的代码了?
找到问题原因了,是xcode设置的问题导致修改pod里的代码不生效。
还有个问题,在pod代码里修改cellHeight好像没变化了,我记的以前是可以通过调整这个参数修改文字框的高度的。
@slash130 cell.titleLabelHeight = cellHeight
仅支持了单独的文本轮播了,如果需要你可以考虑进行源码修改,在collectionView
的数据源代理中cellForItemAt
.
嗯 我修改源码后ok了
@slash130 嗯,后续我会更新新版本。
我尝试在LLCycleScrollViewCell里修改setupTitleLabel添加文字居中设置,添加后不生效。谁知道怎么设置居中显示?