|
@@ -34,7 +34,8 @@ class TSAIDiyVideoVC: TSBaseVC {
|
|
|
dataSource.isTitleColorGradientEnabled = true
|
|
|
dataSource.isItemSpacingAverageEnabled = false
|
|
|
dataSource.itemSpacing = 0
|
|
|
- dataSource.itemWidth = (k_ScreenWidth-36)/2.0
|
|
|
+ dataSource.itemWidth = itemWidth//(k_ScreenWidth-36)/2.0
|
|
|
+ dataSource.itemWidthIncrement = 0
|
|
|
dataSource.titles = ["Image to Video".localized,"Text to Video".localized]
|
|
|
dataSource.titleNormalColor = .white.withAlphaComponent(0.8)
|
|
|
dataSource.titleSelectedColor = "#111111".uiColor
|
|
@@ -43,25 +44,26 @@ class TSAIDiyVideoVC: TSBaseVC {
|
|
|
return dataSource
|
|
|
}()
|
|
|
|
|
|
+ lazy var itemWidth:CGFloat = (UIScreen.main.bounds.size.width-32)/2.0
|
|
|
//配置指示器
|
|
|
lazy var indicator: JXSegmentedIndicatorBackgroundView = {
|
|
|
let indicator = JXSegmentedIndicatorBackgroundView()
|
|
|
- indicator.indicatorWidth = JXSegmentedViewAutomaticDimension
|
|
|
+ indicator.indicatorWidth = itemWidth-4
|
|
|
+ indicator.indicatorWidthIncrement = 0
|
|
|
indicator.indicatorHeight = 36
|
|
|
indicator.indicatorColor = .themeColor
|
|
|
- indicator.cornerRadius = 18
|
|
|
+ indicator.indicatorCornerRadius = 18
|
|
|
+ indicator.indicatorPosition = .center
|
|
|
return indicator
|
|
|
}()
|
|
|
|
|
|
|
|
|
lazy var segmentedView: JXSegmentedView = {
|
|
|
- let segmentedView = JXSegmentedView(frame: CGRect(x: 16, y: 8, width: UIScreen.main.bounds.size.width-32, height: 40.0))
|
|
|
+ let segmentedView = JXSegmentedView(frame: CGRect(x: 16, y: 8, width: UIScreen.main.bounds.size.width-32, height: 40.0))
|
|
|
segmentedView.delegate = self
|
|
|
segmentedView.indicators = [indicator]
|
|
|
segmentedView.dataSource = segmentedDataSource
|
|
|
segmentedView.backgroundColor = segmentedBgColor
|
|
|
-// segmentedView.contentEdgeInsetLeft = 2
|
|
|
-// segmentedView.contentEdgeInsetRight = 2
|
|
|
segmentedView.listContainer = listContainerView
|
|
|
segmentedView.cornerRadius = 20
|
|
|
return segmentedView
|