Commit 2784cb6f authored by Steven杜宇's avatar Steven杜宇

// 我的收藏UI

parent d5f09da1
...@@ -25,7 +25,7 @@ class YHServiceTableFootView: UIView { ...@@ -25,7 +25,7 @@ class YHServiceTableFootView: UIView {
let flowLayout = YHHomeCollectionLayout() let flowLayout = YHHomeCollectionLayout()
flowLayout.minimumInteritemSpacing = 7.0 flowLayout.minimumInteritemSpacing = 7.0
flowLayout.minimumColumnSpacing = 7.0 flowLayout.minimumColumnSpacing = 7.0
flowLayout.sectionInset = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20) flowLayout.sectionInset = UIEdgeInsets(top: 0, left: 24, bottom: 20, right: 24)
let collectinoView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout) let collectinoView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
collectinoView.backgroundColor = .white collectinoView.backgroundColor = .white
collectinoView.register(YHHomeCollectionViewCell.self, forCellWithReuseIdentifier:YHHomeCollectionViewCell.cellReuseIdentifier) collectinoView.register(YHHomeCollectionViewCell.self, forCellWithReuseIdentifier:YHHomeCollectionViewCell.cellReuseIdentifier)
......
...@@ -20,18 +20,21 @@ class YHMyLikeActivityViewController: YHBaseViewController { ...@@ -20,18 +20,21 @@ class YHMyLikeActivityViewController: YHBaseViewController {
var arrItemTitles: [String] = ["我的点赞", "我的收藏", "最近浏览"] var arrItemTitles: [String] = ["我的点赞", "我的收藏", "最近浏览"]
var arrItemVCs : [YHMyLikeViewController] = [] var arrItemVCs : [YHMyLikeViewController] = []
var segmentedView : JXSegmentedView = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_NavigationtBarAndStatuBar, width: KScreenWidth, height: 48)) lazy var segmentedView : JXSegmentedView = {
let view = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_NavigationtBarAndStatuBar, width: KScreenWidth, height: 48))
view.backgroundColor = .white
return view
}()
lazy var segmentedDataSource: JXSegmentedTitleDataSource = { lazy var segmentedDataSource: JXSegmentedTitleDataSource = {
let dataSource = JXSegmentedTitleDataSource() let dataSource = JXSegmentedTitleDataSource()
dataSource.titles = arrItemTitles dataSource.titles = arrItemTitles
dataSource.titleNormalFont = UIFont.PFSC_M(ofSize: 16)
dataSource.titleNormalFont = UIFont.PFSC_M(ofSize: 14)
dataSource.titleNormalColor = .labelTextColor2 dataSource.titleNormalColor = .labelTextColor2
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 16)
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 14)
dataSource.titleSelectedColor = .mainTextColor dataSource.titleSelectedColor = .mainTextColor
dataSource.isItemSpacingAverageEnabled = true dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension dataSource.itemWidth = 62.0
dataSource.itemSpacing = 24.0
return dataSource return dataSource
}() }()
...@@ -43,6 +46,7 @@ class YHMyLikeActivityViewController: YHBaseViewController { ...@@ -43,6 +46,7 @@ class YHMyLikeActivityViewController: YHBaseViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = .white
for i in 0..<arrItemTitles.count { for i in 0..<arrItemTitles.count {
if i == 0 { if i == 0 {
let vc = YHMyLikeViewController() let vc = YHMyLikeViewController()
...@@ -62,10 +66,19 @@ class YHMyLikeActivityViewController: YHBaseViewController { ...@@ -62,10 +66,19 @@ class YHMyLikeActivityViewController: YHBaseViewController {
segmentedView.dataSource = segmentedDataSource segmentedView.dataSource = segmentedDataSource
segmentedView.delegate = self segmentedView.delegate = self
view.addSubview(segmentedView) view.addSubview(segmentedView)
segmentedView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.height.equalTo(48.0)
}
segmentedView.listContainer = listContainerView segmentedView.listContainer = listContainerView
view.addSubview(listContainerView) view.addSubview(listContainerView)
listContainerView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(segmentedView.snp.bottom).offset(4.0)
make.bottom.equalToSuperview()
}
//分类Title //分类Title
segmentedView.dataSource = segmentedDataSource segmentedView.dataSource = segmentedDataSource
...@@ -73,7 +86,8 @@ class YHMyLikeActivityViewController: YHBaseViewController { ...@@ -73,7 +86,8 @@ class YHMyLikeActivityViewController: YHBaseViewController {
//配置指示器 //配置指示器
let indicator = JXSegmentedIndicatorLineView() let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16 indicator.indicatorWidth = 16.0
indicator.indicatorHeight = 2.0
indicator.indicatorColor = UIColor.brandMainColor indicator.indicatorColor = UIColor.brandMainColor
indicator.indicatorCornerRadius = 0 indicator.indicatorCornerRadius = 0
segmentedView.indicators = [indicator] segmentedView.indicators = [indicator]
...@@ -101,14 +115,6 @@ class YHMyLikeActivityViewController: YHBaseViewController { ...@@ -101,14 +115,6 @@ class YHMyLikeActivityViewController: YHBaseViewController {
//离开页面的时候,需要恢复屏幕边缘手势,不能影响其他页面 //离开页面的时候,需要恢复屏幕边缘手势,不能影响其他页面
navigationController?.interactivePopGestureRecognizer?.isEnabled = true navigationController?.interactivePopGestureRecognizer?.isEnabled = true
} }
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
segmentedView.frame = CGRect(x: 0, y: k_Height_NavigationtBarAndStatuBar, width: view.bounds.size.width, height: 48)
listContainerView.frame = CGRect(x: 0, y: k_Height_NavigationtBarAndStatuBar + 48, width: view.bounds.size.width, height: view.bounds.size.height - 48 - k_Height_NavigationtBarAndStatuBar)
segmentedView.backgroundColor = .white
}
} }
extension YHMyLikeActivityViewController: JXSegmentedViewDelegate { extension YHMyLikeActivityViewController: JXSegmentedViewDelegate {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment