diff --git a/SwiftProject/SwiftProject/Assets.xcassets/icon/photomoreBtn.imageset/Contents.json b/SwiftProject/SwiftProject/Assets.xcassets/icon/photomoreBtn.imageset/Contents.json new file mode 100644 index 0000000..4b7bf60 --- /dev/null +++ b/SwiftProject/SwiftProject/Assets.xcassets/icon/photomoreBtn.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Frame.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SwiftProject/SwiftProject/Assets.xcassets/icon/photomoreBtn.imageset/Frame.png b/SwiftProject/SwiftProject/Assets.xcassets/icon/photomoreBtn.imageset/Frame.png new file mode 100644 index 0000000..c2b0986 Binary files /dev/null and b/SwiftProject/SwiftProject/Assets.xcassets/icon/photomoreBtn.imageset/Frame.png differ diff --git a/SwiftProject/SwiftProject/Assets.xcassets/icon/photomoreBtn.imageset/Frame@2x.png b/SwiftProject/SwiftProject/Assets.xcassets/icon/photomoreBtn.imageset/Frame@2x.png new file mode 100644 index 0000000..cff5a18 Binary files /dev/null and b/SwiftProject/SwiftProject/Assets.xcassets/icon/photomoreBtn.imageset/Frame@2x.png differ diff --git a/SwiftProject/SwiftProject/Assets.xcassets/icon/photomoreBtn.imageset/Frame@3x.png b/SwiftProject/SwiftProject/Assets.xcassets/icon/photomoreBtn.imageset/Frame@3x.png new file mode 100644 index 0000000..b46756d Binary files /dev/null and b/SwiftProject/SwiftProject/Assets.xcassets/icon/photomoreBtn.imageset/Frame@3x.png differ diff --git a/SwiftProject/SwiftProject/Project/View/Album/CCSpaceAlbumFliterPopView/CCSpaceAlbumFliterPopView.swift b/SwiftProject/SwiftProject/Project/View/Album/CCSpaceAlbumFliterPopView/CCSpaceAlbumFliterPopView.swift index 3b8ae75..7bf43c5 100644 --- a/SwiftProject/SwiftProject/Project/View/Album/CCSpaceAlbumFliterPopView/CCSpaceAlbumFliterPopView.swift +++ b/SwiftProject/SwiftProject/Project/View/Album/CCSpaceAlbumFliterPopView/CCSpaceAlbumFliterPopView.swift @@ -90,12 +90,7 @@ class CCSpaceAlbumFliterPopView: UIView { lazy var filtersButton: UIButton = { let button = UIButton.init() - button.backgroundColor = .green - button.setImage(UIImage(named: "filters_button"), for: .normal) -// button.setTitle("取消", for: .normal) -// button.setTitleColor(KMain_Color, for: .normal) -// button.titleLabel?.font = KFont_Medium(16) -// button.contentHorizontalAlignment = .center + button.setImage(UIImage(named: "photomoreBtn"), for: .normal) button.addTarget(self, action: #selector(filtersButtonAction), for: .touchUpInside) return button @@ -455,6 +450,8 @@ extension CCSpaceAlbumFliterPopView:UICollectionViewDataSource, UICollectionView // cell.frameCountLabel.text = "普通" // }else{ cell.frameCountLabel.text = "空间" + cell.frameCountLabel.isHidden = false + cell.timeLabel.isHidden = true // } @@ -463,7 +460,10 @@ extension CCSpaceAlbumFliterPopView:UICollectionViewDataSource, UICollectionView let time:Double = Double(model.itemAsset!.duration) let timeStr:String = self.transToHourMinSec(second:Int(time)) - cell.frameCountLabel.text = timeStr +// cell.frameCountLabel.text = timeStr + cell.frameCountLabel.isHidden = true + cell.timeLabel.isHidden = false + cell.timeLabel.text = timeStr } @@ -550,6 +550,18 @@ class CCSpaceAlbumFliterCollectionCell: UICollectionViewCell { return label }() + let timeLabel: UILabel = { + let label = UILabel() + label.textColor = .white + label.backgroundColor = UIColor(hexString: "#383739") + label.textAlignment = .center + label.font = UIFont.boldSystemFont(ofSize: 12) + label.layer.cornerRadius = 8 + label.adjustsFontSizeToFitWidth = true + label.layer.masksToBounds = true + return label + }() + override init(frame: CGRect) { super.init(frame: frame) setupViews() @@ -563,9 +575,12 @@ class CCSpaceAlbumFliterCollectionCell: UICollectionViewCell { private func setupViews() { addSubview(imageView) addSubview(frameCountLabel) + addSubview(timeLabel); imageView.translatesAutoresizingMaskIntoConstraints = false frameCountLabel.translatesAutoresizingMaskIntoConstraints = false + timeLabel.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate([ imageView.topAnchor.constraint(equalTo: topAnchor), @@ -576,7 +591,12 @@ class CCSpaceAlbumFliterCollectionCell: UICollectionViewCell { frameCountLabel.topAnchor.constraint(equalTo: topAnchor, constant: 8), frameCountLabel.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 8), frameCountLabel.widthAnchor.constraint(equalToConstant: 40), - frameCountLabel.heightAnchor.constraint(equalToConstant: 20) + frameCountLabel.heightAnchor.constraint(equalToConstant: 20), + + timeLabel.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -8), + timeLabel.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -8), + timeLabel.widthAnchor.constraint(equalToConstant: 40), + timeLabel.heightAnchor.constraint(equalToConstant: 20) ]) } }