Commit 3c8b6e2a authored by CZ1004's avatar CZ1004

优化

parent 57db134a
{
"images" : [
{
"filename" : "but_clean_home.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "but_clean_home@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "but_clean_home@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_pro_home.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_pro_home@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_pro_home@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_setting_com.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_setting_com@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_setting_com@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "img_bj_home.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "img_bj_home@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_bj_home@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "img_file_home.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "img_file_home@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_file_home@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/> <device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
......
...@@ -35,8 +35,7 @@ class ChargeViewController:BaseViewController { ...@@ -35,8 +35,7 @@ class ChargeViewController:BaseViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = .green
titleView.addSubview(detailsBtn) titleView.addSubview(detailsBtn)
......
...@@ -46,9 +46,31 @@ class HomeViewController:BaseViewController { ...@@ -46,9 +46,31 @@ class HomeViewController:BaseViewController {
} }
} }
lazy var imageView : UIImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "img_bj_home")
imageView.backgroundColor = .clear
return imageView
}()
func setupUI(){
// 第一个背景
self.view.addSubview(self.imageView)
self.imageView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(450 * RScreenH())
}
self.view.backgroundColor = UIColor(red: 0.95, green: 0.96, blue: 0.99, alpha: 1)
}
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
self.setupUI()
// 调用下追踪权限 // 调用下追踪权限
checkTrackingAuthorization() checkTrackingAuthorization()
...@@ -84,8 +106,6 @@ class HomeViewController:BaseViewController { ...@@ -84,8 +106,6 @@ class HomeViewController:BaseViewController {
let homeSimilarImageResourceUpdate = Notification.Name("HomeSimilarImageResourceUpdate") let homeSimilarImageResourceUpdate = Notification.Name("HomeSimilarImageResourceUpdate")
NotificationCenter.default.addObserver(self, selector: #selector(handleHomeSimilarImageResourceUpdate(_:)), name: homeSimilarImageResourceUpdate, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(handleHomeSimilarImageResourceUpdate(_:)), name: homeSimilarImageResourceUpdate, object: nil)
view.backgroundColor = .green
homeView = HomeView(frame: view.bounds) homeView = HomeView(frame: view.bounds)
...@@ -161,19 +181,6 @@ class HomeViewController:BaseViewController { ...@@ -161,19 +181,6 @@ class HomeViewController:BaseViewController {
} }
/// 弹出广告
func popAdverTisement(){
}
override func addViews() {
}
func setupData() { func setupData() {
// 详情数据 // 详情数据
......
//
// HomeCollectionViewHeader.swift
// PhoneManager
//
// Created by edy on 2025/4/24.
//
import Foundation
class HomeCollectionViewHeader : UICollectionReusableView {
var cleanNowButtonCallback : () -> Void = {}
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = .clear
setupUI()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
setupUI()
}
private lazy var logoImageView:UIImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "img_file_home")
imageView.backgroundColor = .clear
return imageView
}()
private lazy var cleanNowButton : UIButton = {
let button = UIButton(type: .custom)
button.backgroundColor = .clear
button.setImage(UIImage(named: "but_clean_home"), for: .normal)
button.addTarget(self, action: #selector(clickCleanNowButton), for: .touchUpInside)
return button
}()
private var tipLabel:UILabel = {
let label = UILabel()
label.numberOfLines = 0 // 支持多行
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()
private lazy var subTiplabel : UILabel = {
let label = UILabel()
label.textAlignment = .left
label.text = "of storage to clean up"
label.textColor = UIColor(red: 0.4, green: 0.4, blue: 0.4, alpha: 1)
label.font = UIFont.systemFont(ofSize: 14, weight: .regular)
return label
}()
private func setupUI() {
// logo图片
self.addSubview(self.logoImageView)
self.logoImageView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(8)
make.right.equalToSuperview()
make.width.height.equalTo(182)
}
// 文本
self.addSubview(tipLabel)
self.tipLabel.snp.makeConstraints { make in
make.left.equalToSuperview()
make.top.equalToSuperview().offset(32)
make.height.equalTo(31)
}
self.addSubview(self.subTiplabel)
self.subTiplabel.snp.makeConstraints { make in
make.top.equalTo(self.tipLabel.snp.bottom).offset(4)
make.left.equalToSuperview()
make.width.equalTo(168)
make.height.equalTo(20)
}
// 按钮
self.addSubview(self.cleanNowButton)
self.cleanNowButton.snp.makeConstraints { make in
make.top.equalTo(self.subTiplabel.snp.bottom).offset(24)
make.left.equalToSuperview()
make.width.equalTo(159)
make.height.equalTo(45)
}
}
@objc func clickCleanNowButton(){
cleanNowButtonCallback()
}
func setFileAndCount(count:Int,fileSize:Double) {
let countString = "\(count)"
let fileSizeString = formatFileSize(fileSize)
let text = countString + " files · " + fileSizeString
let attributedText = NSMutableAttributedString(string: text)
// 设置整体文本样式
let fullTextAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.systemFont(ofSize: 18, weight: .bold),
.foregroundColor: UIColor(red: 0.4, green: 0.4, blue: 0.4,alpha:1)
]
attributedText.addAttributes(fullTextAttributes, range: NSRange(location: 0, length: text.count))
// 设置 "202" 为蓝色
if let range1 = text.range(of: countString) {
let nsRange1 = NSRange(range1, in: text)
attributedText.addAttributes([
.foregroundColor: UIColor.colorWithHex(hexStr: mColor),
.font:UIFont.systemFont(ofSize: 21, weight: .bold)
], range: nsRange1)
}
// 设置 "1.15 GB" 为蓝色
if let range2 = text.range(of: fileSizeString) {
let nsRange2 = NSRange(range2, in: text)
attributedText.addAttributes([
.font:UIFont.systemFont(ofSize: 21, weight: .bold),
.foregroundColor: UIColor.colorWithHex(hexStr: mColor)
], range: nsRange2)
}
// 将 attributedText 赋值给 UILabel
self.tipLabel.attributedText = attributedText
}
}
...@@ -9,11 +9,16 @@ import UIKit ...@@ -9,11 +9,16 @@ import UIKit
class HomeNavView:UIView { class HomeNavView:UIView {
// private var titleLabel:UILabel!
private var settingBtn:UIButton! private var settingBtn:UIButton!
private var proBtn:UIButton! private var proBtn:UIButton!
private var tipLabel:UILabel! private lazy var homeTitle : UILabel = {
let label = UILabel()
label.textAlignment = .center
label.text = "Phone Manager"
label.textColor = UIColor(red: 0.2, green: 0.2, blue: 0.2, alpha: 1)
label.font = UIFont.systemFont(ofSize: 20, weight: .bold)
return label
}()
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
...@@ -27,71 +32,51 @@ class HomeNavView:UIView { ...@@ -27,71 +32,51 @@ class HomeNavView:UIView {
private func setupUI() { private func setupUI() {
backgroundColor = .white backgroundColor = .clear
// titleLabel = UILabel() // 标题
// titleLabel.text = "Cleanup" self.addSubview(self.homeTitle)
// titleLabel.font = UIFont.systemFont(ofSize: 20, weight: .bold) self.homeTitle.snp.makeConstraints { make in
// titleLabel.textColor = UIColor.colorWithHex(hexStr: black3Color) make.left.equalTo(15)
// titleLabel.sizeToFit() make.top.equalTo(8 + statusBarHeight)
// make.height.equalTo(28)
// self.addSubview(titleLabel) make.width.equalTo(149)
// }
// titleLabel.snp.makeConstraints { make in
//
// make.centerY.equalTo(navCenterY)
// make.left.equalTo(marginLR)
// }
settingBtn = UIButton() // 设置按钮
settingBtn.setImage(UIImage(named: "home_setting_icon"), for: .normal) self.settingBtn = UIButton()
settingBtn.addTarget(self, action: #selector(settingBtnClick), for: .touchUpInside) self.settingBtn.setImage(UIImage(named: "ic_setting_com"), for: .normal)
self.settingBtn.addTarget(self, action: #selector(settingBtnClick), for: .touchUpInside)
self.addSubview(settingBtn) self.addSubview(settingBtn)
self.settingBtn.snp.makeConstraints { make in
settingBtn.snp.makeConstraints { make in make.centerY.equalTo(self.homeTitle.snp.centerY)
// make.centerY.equalTo(navCenterY) make.right.equalTo(-marginLR)
// make.right.equalToSuperview().offset(-marginLR)
make.centerY.equalTo(navCenterY)
make.left.equalTo(marginLR)
make.width.height.equalTo(iconWH) make.width.height.equalTo(iconWH)
} }
proBtn = UIButton(frame: CGRect(x: 0, y: 0, width: 70, height: iconWH))
proBtn.setBackgroundImage(UIImage(named: "home_pro_star_back"), for: .normal)
proBtn.addTarget(self, action: #selector(proBtnClick), for: .touchUpInside)
self.addSubview(proBtn)
proBtn.snp.makeConstraints { make in // 会员按钮
self.proBtn = UIButton(frame: CGRect(x: 0, y: 0, width: 70, height: iconWH))
// make.centerY.equalTo(navCenterY) self.proBtn.setBackgroundImage(UIImage(named: "ic_pro_home"), for: .normal)
// make.right.equalTo(settingBtn.snp.left).offset(-8) self.proBtn.addTarget(self, action: #selector(proBtnClick), for: .touchUpInside)
make.centerY.equalTo(navCenterY) self.addSubview(proBtn)
make.right.equalToSuperview().offset(-marginLR) self.proBtn.snp.makeConstraints { make in
make.width.equalTo(70) make.centerY.equalTo(self.homeTitle.snp.centerY)
make.right.equalTo(self.settingBtn.snp.left).offset(-8)
make.width.equalTo(78)
make.height.equalTo(iconWH) make.height.equalTo(iconWH)
} }
tipLabel = UILabel()
tipLabel.numberOfLines = 0 // 支持多行
tipLabel.translatesAutoresizingMaskIntoConstraints = false
self.addSubview(tipLabel)
// 设置文本内容
} }
}
extension HomeNavView {
@objc private func settingBtnClick() { @objc private func settingBtnClick() {
let homeNavViewModel = HomeNavViewModel() let homeNavViewModel = HomeNavViewModel()
let settingViewController = SettingViewController() let settingViewController = SettingViewController()
homeNavViewModel.pushToDetailController(currentView: self, destnationController: settingViewController) homeNavViewModel.pushToDetailController(currentView: self, destnationController: settingViewController)
// let homeNavViewModel = HomeNavViewModel()
// let vc = AdvViewController()
// vc.modalPresentationStyle = .fullScreen
// self.responderViewController()?.present(vc, animated: true)
//
} }
@objc private func proBtnClick() { @objc private func proBtnClick() {
if HomePayModel.share.isNoAd == false { if HomePayModel.share.isNoAd == false {
...@@ -102,49 +87,4 @@ class HomeNavView:UIView { ...@@ -102,49 +87,4 @@ class HomeNavView:UIView {
self.responderViewController()?.present(vc, animated: true) self.responderViewController()?.present(vc, animated: true)
} }
} }
func setFileAndCount(count:Int,fileSize:Double) {
let countString = "\(count)"
let fileSizeString = formatFileSize(fileSize)
let text = countString + " files · " + fileSizeString + " of storage to clean up"
let attributedText = NSMutableAttributedString(string: text)
// 设置整体文本样式
let fullTextAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.systemFont(ofSize: 14),
.foregroundColor: UIColor(red: 102/255, green: 102/255, blue: 102/255, alpha: 1) // #666666
]
attributedText.addAttributes(fullTextAttributes, range: NSRange(location: 0, length: text.count))
// 设置 "202" 为蓝色
if let range1 = text.range(of: countString) {
let nsRange1 = NSRange(range1, in: text)
attributedText.addAttributes([
.foregroundColor: UIColor.colorWithHex(hexStr: mColor),
.font:UIFont.systemFont(ofSize: 14, weight: .bold)
], range: nsRange1)
}
// 设置 "1.15 GB" 为蓝色
if let range2 = text.range(of: fileSizeString) {
let nsRange2 = NSRange(range2, in: text)
attributedText.addAttributes([
.font:UIFont.systemFont(ofSize: 14, weight: .bold),
.foregroundColor: UIColor.colorWithHex(hexStr: mColor)
], range: nsRange2)
}
// 将 attributedText 赋值给 UILabel
tipLabel.attributedText = attributedText
tipLabel.snp.makeConstraints { make in
make.bottom.equalToSuperview().offset(-16)
make.centerX.equalToSuperview()
make.width.equalToSuperview().offset(-2 * marginLR)
}
}
} }
...@@ -16,6 +16,8 @@ class HomeView:UIView { ...@@ -16,6 +16,8 @@ class HomeView:UIView {
private var bottomView:UIView? private var bottomView:UIView?
var homeHeader : HomeCollectionViewHeader?
var dupHeadCell : HomeTitleCollectionCell? var dupHeadCell : HomeTitleCollectionCell?
var similarHeadCell : HomeTitleCollectionCell? var similarHeadCell : HomeTitleCollectionCell?
...@@ -52,12 +54,16 @@ class HomeView:UIView { ...@@ -52,12 +54,16 @@ class HomeView:UIView {
sview.dataSource = self sview.dataSource = self
sview.delegate = self sview.delegate = self
sview.showsVerticalScrollIndicator = false sview.showsVerticalScrollIndicator = false
sview.register(HomeTitleCollectionCell.self, forCellWithReuseIdentifier: HomeTitleCollectionCell.identifiers) sview.register(HomeTitleCollectionCell.self, forCellWithReuseIdentifier: HomeTitleCollectionCell.identifiers)
sview.register(HomeOtherCollectionCell.self, forCellWithReuseIdentifier: HomeOtherCollectionCell.identifier) sview.register(HomeOtherCollectionCell.self, forCellWithReuseIdentifier: HomeOtherCollectionCell.identifier)
sview.register(HomeCollectionViewHeader.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "HomeCollectionViewHeader")
sview.register(UICollectionReusableView.self,forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter,withReuseIdentifier: "HomeCollectionViewFooter")
if #available(iOS 11.0, *) { if #available(iOS 11.0, *) {
sview.contentInsetAdjustmentBehavior = .never sview.contentInsetAdjustmentBehavior = .never
} }
sview.backgroundColor = .clear sview.backgroundColor = .clear
return sview return sview
...@@ -106,7 +112,7 @@ class HomeView:UIView { ...@@ -106,7 +112,7 @@ class HomeView:UIView {
guard let self else {return} guard let self else {return}
self.homeNavView?.setFileAndCount(count: model?.allFileNumber ?? 0, fileSize: model?.allFileSize ?? 0) self.homeHeader?.setFileAndCount(count: model?.allFileNumber ?? 0, fileSize: model?.allFileSize ?? 0)
} }
} }
...@@ -119,7 +125,7 @@ class HomeView:UIView { ...@@ -119,7 +125,7 @@ class HomeView:UIView {
guard let self else {return} guard let self else {return}
self.homeNavView?.setFileAndCount(count: model.allFileNumber, fileSize: model.allFileSize) self.homeHeader?.setFileAndCount(count: model.allFileNumber, fileSize: model.allFileSize)
self.collectionView.reloadData() self.collectionView.reloadData()
} }
...@@ -129,7 +135,7 @@ class HomeView:UIView { ...@@ -129,7 +135,7 @@ class HomeView:UIView {
guard let self else {return} guard let self else {return}
self.homeNavView?.setFileAndCount(count: model.allFileNumber, fileSize: model.allFileSize) self.homeHeader?.setFileAndCount(count: model.allFileNumber, fileSize: model.allFileSize)
self.collectionView.reloadData() self.collectionView.reloadData()
} }
...@@ -141,14 +147,12 @@ class HomeView:UIView { ...@@ -141,14 +147,12 @@ class HomeView:UIView {
} }
func setData() { func setData() {
// 加载数据
} }
private func setupUI() { private func setupUI() {
backgroundColor = .white backgroundColor = .clear
homeTabbarView = HomeTabbarView(frame: CGRect(x: 0, y: 0, width: self.width, height: safeHeight + 66)) homeTabbarView = HomeTabbarView(frame: CGRect(x: 0, y: 0, width: self.width, height: safeHeight + 66))
...@@ -167,24 +171,20 @@ class HomeView:UIView { ...@@ -167,24 +171,20 @@ class HomeView:UIView {
self.indexCallBack(index) self.indexCallBack(index)
} }
homeNavView = HomeNavView(frame: CGRect(x: 0, y: 0, width: width, height: statusBarHeight + 96)) homeNavView = HomeNavView(frame: CGRect(x: 0, y: 0, width: width, height: statusBarHeight + 44))
self.addSubview(homeNavView!) self.addSubview(homeNavView!)
homeNavView?.snp.makeConstraints({ make in homeNavView?.snp.makeConstraints({ make in
make.top.centerX.width.equalToSuperview() make.top.centerX.width.equalToSuperview()
make.height.equalTo(statusBarHeight + 96) make.height.equalTo(statusBarHeight + 44)
}) })
Print("statusBarHeight----\(statusBarHeight)")
bottomView = UIView(frame: CGRect(x: 0, y: 0, width: width, height: safeHeight + 10)) bottomView = UIView(frame: CGRect(x: 0, y: 0, width: width, height: safeHeight + 10))
bottomView?.backgroundColor = .white bottomView?.backgroundColor = .white
self.addSubview(bottomView!) self.addSubview(bottomView!)
bottomView?.snp.makeConstraints({ make in bottomView?.snp.makeConstraints({ make in
make.centerX.width.equalToSuperview() make.centerX.width.equalToSuperview()
make.bottom.equalToSuperview().offset(10) make.bottom.equalToSuperview().offset(10)
make.height.equalTo(safeHeight + 10) make.height.equalTo(safeHeight + 10)
...@@ -193,12 +193,13 @@ class HomeView:UIView { ...@@ -193,12 +193,13 @@ class HomeView:UIView {
self.insertSubview(collectionView, at: 0) self.insertSubview(collectionView, at: 0)
collectionView.snp.makeConstraints { make in collectionView.snp.makeConstraints { make in
make.top.equalTo(self.homeNavView!.snp.bottom).offset(16)
make.center.height.equalToSuperview() make.centerX.equalToSuperview()
make.width.equalToSuperview().offset(-2 * marginLR) make.width.equalToSuperview().offset(-2 * marginLR)
make.bottom.equalToSuperview().offset( -homeTabbarView!.height - 16)
} }
collectionView.contentInset = UIEdgeInsets(top: homeTabbarView!.height + 49, left: 0, bottom: homeTabbarView!.height + 16, right: 0) // collectionView.contentInset = UIEdgeInsets(top: homeTabbarView!.height + 49, left: 0, bottom: homeTabbarView!.height + 16, right: 0)
} }
...@@ -343,4 +344,37 @@ extension HomeView:WaterfallMutiSectionDelegate,UICollectionViewDataSource,UICol ...@@ -343,4 +344,37 @@ extension HomeView:WaterfallMutiSectionDelegate,UICollectionViewDataSource,UICol
otherItemCallBack(smodel!,indexPath.row) otherItemCallBack(smodel!,indexPath.row)
} }
} }
// 返回头部视图
func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
if kind == UICollectionView.elementKindSectionHeader {
let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "HomeCollectionViewHeader", for: indexPath) as! HomeCollectionViewHeader
self.homeHeader = header
header.cleanNowButtonCallback = {[weak self] in
guard let self = self else {return}
let smodel = self.model?.titleModelArray[0]
let vc = HomeInfoViewController(ids: smodel!.assets , type: .duplicates,titleText: smodel!.folderName)
self.responderViewController()?.navigationController?.pushViewController(vc, animated: true)
}
if indexPath.section != 0 {
header.isHidden = true
}else{
header.isHidden = false
}
return header
} else if kind == UICollectionView.elementKindSectionFooter {
let footer = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "HomeCollectionViewFooter", for: indexPath)
return footer
}
return UICollectionReusableView(frame: .zero)
}
// 设置头部视图的大小
func referenceSizeForHeader(collectionView collection: UICollectionView, layout: WaterfallMutiSectionFlowLayout, section: Int) -> CGSize {
if section == 0 {
return CGSize(width: self.collectionView.width, height: 210)
}
return CGSize.zero
}
} }
...@@ -84,7 +84,7 @@ class HomeOtherCollectionCell: UICollectionViewCell { ...@@ -84,7 +84,7 @@ class HomeOtherCollectionCell: UICollectionViewCell {
// MARK: - Setup // MARK: - Setup
private func setupUI() { private func setupUI() {
backgroundColor = UIColor.colorWithHex(hexStr: "#F2F6FC") backgroundColor = .white
self.contentView.addSubview(self.titleLabel) self.contentView.addSubview(self.titleLabel)
self.contentView.addSubview(self.imageView) self.contentView.addSubview(self.imageView)
self.contentView.addSubview(self.playImageView) self.contentView.addSubview(self.playImageView)
......
...@@ -39,7 +39,7 @@ class HomeTitleCollectionCell:UICollectionViewCell { ...@@ -39,7 +39,7 @@ class HomeTitleCollectionCell:UICollectionViewCell {
func setupUI() { func setupUI() {
self.backgroundColor = UIColor.colorWithHex(hexStr: "#F2F6FC") self.backgroundColor = .white
self.layer.cornerRadius = 12 self.layer.cornerRadius = 12
self.layer.masksToBounds = true self.layer.masksToBounds = true
......
...@@ -13,7 +13,6 @@ class ViewController: UIViewController { ...@@ -13,7 +13,6 @@ class ViewController: UIViewController {
super.viewDidLoad() super.viewDidLoad()
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
view.backgroundColor = .green
} }
......
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