소스 검색

调整 UI

jsonwang 4 년 전
부모
커밋
706fdde33f

+ 11 - 19
MusicVideoPlus/MusicVideoPlus/Classes/Modules/Home/Views/MVBannerCell.swift

@@ -54,17 +54,13 @@ class MVBannerCell: UICollectionViewCell {
     lazy var musicNameLab: LMJHorizontalScrollText = {
         let name:String = "文件名称"
         let nameWidth: CGFloat = sizeWithText(text: "\(name)", font: UIFont.systemFont(ofSize: 13), size: CGSize(width: cScreenWidth - ((cDefaultMargin * 6 + 16 * 2) * 2) - (25 + cDefaultMargin * 3), height: cDefaultMargin * 3)).width
-        let musicNameLab = LMJHorizontalScrollText(frame: CGRect(x: 0, y: 0, width: nameWidth < cDefaultMargin * 4 ? cDefaultMargin * 4 : nameWidth, height: cDefaultMargin * 3))
+        let musicNameLab = LMJHorizontalScrollText(frame: CGRect(x: 0, y: 0, width: nameWidth < 147 ? 147 : nameWidth, height: cDefaultMargin * 3))
         musicNameLab.textColor = UIColor.white
         musicNameLab.textFont = UIFont.systemFont(ofSize: 13)
+
         musicNameLab.speed = 0.03
         musicNameLab.moveDirection = LMJTextScrollMoveLeft
         musicNameLab.moveMode = LMJTextScrollContinuous
-        if nameWidth < cDefaultMargin * 4 {
-            musicNameLab.text = " \(name) "
-        } else {
-            musicNameLab.text = "\(name)"
-        }
         return musicNameLab
     }()
     
@@ -76,11 +72,9 @@ class MVBannerCell: UICollectionViewCell {
         musicNameView.addSubview(musicNameLab)
         let nameWidth: CGFloat = musicNameLab.frame.width + (25 + cDefaultMargin * 3)
         musicNameView.frame = CGRect(x: 16, y: 492, width: nameWidth, height: cDefaultMargin * 3)
-//        musicNameView.backgroundColor = UIColor.hexColor(hexadecimal: "#333333")
-        musicNameView.addCorner(corner: musicNameView.frame.height / 2)
-    
+  
         let musicImageView = UIImageView(image:UIImage.init().BF_Image(named: "stuckPoint_reCreate_music"))
-        musicImageView.frame = CGRect(x: musicNameView.frame.height / 2 - 5, y: (musicNameView.frame.height - 22) / 2, width: 22, height: 22)
+        musicImageView.frame = CGRect(x:0, y: (musicNameView.frame.height - 22) / 2, width: 22, height: 22)
         musicNameView.addSubview(musicImageView)
         musicNameLab.frame.origin.x = musicImageView.frame.maxX + 5
         return musicNameView
@@ -100,13 +94,13 @@ class MVBannerCell: UICollectionViewCell {
     //视频分类
     lazy var typeLabe: UILabel = {
         let typeLabe = UILabel()
-        typeLabe.backgroundColor = UIColor.init(red: 0, green: 0, blue: 0, alpha: 0.2)
+        typeLabe.backgroundColor = UIColor.init(red: 1, green: 1, blue: 1, alpha: 0.2)
         typeLabe.alpha = 0.8
         typeLabe.textColor = .white
         typeLabe.text = "热门"
         typeLabe.textAlignment = .center
-        typeLabe.addCorner()
-        typeLabe.font = UIFont.systemFont(ofSize: 13)
+        typeLabe.addCorner(corner: 12)
+        typeLabe.font = UIFont.boldSystemFont(ofSize: 13)
         return typeLabe
     }()
     
@@ -120,14 +114,12 @@ class MVBannerCell: UICollectionViewCell {
     
     override func layoutSubviews() {
         super.layoutSubviews()
-      
-
-        
+   
         self.typeLabe.snp.remakeConstraints { make in
             make.width.equalTo(50)
             make.height.equalTo(24)
-            make.left.equalToSuperview().offset(17)
-            make.bottom.equalToSuperview().offset(-14)
+            make.left.equalTo(musicNameView.snp_left)
+            make.top.equalTo(musicNameView.snp_bottom).offset(6)
         }
         
         self.bottmMaskView.snp.remakeConstraints { make in
@@ -174,7 +166,7 @@ class MVBannerCell: UICollectionViewCell {
     func addData() {
         typeLabe.text = videoData?.categoryName
         
-        musicNameLab.text = videoData?.reCreateVideoData?.rhythmMusicName ?? ""
+        musicNameLab.text = " \(videoData?.reCreateVideoData?.rhythmMusicName ?? "")           "
 
         let coverImg = (videoData?.videoCoverSnapshotPath != nil && (videoData?.videoCoverSnapshotPath?.count ?? 0) > 0) ? videoData?.videoCoverSnapshotPath ?? "" : (videoData?.coverImg?["coverImgPath"] as? String ?? "")
         BFLog(message: "coverImg url is \(coverImg)")

+ 5 - 7
MusicVideoPlus/MusicVideoPlus/Classes/Modules/Home/Views/MVTagsCell.swift

@@ -21,8 +21,8 @@ class MVTagsCell: UICollectionViewCell {
  
     lazy var titleLab: UILabel = {
         let titleLab = UILabel()
-        titleLab.font = UIFont.boldSystemFont(ofSize: 15)
-        titleLab.textColor = UIColor.white
+        titleLab.textAlignment = .left
+        titleLab.backgroundColor = .clear
         return titleLab
     }()
  
@@ -37,9 +37,7 @@ class MVTagsCell: UICollectionViewCell {
         contentView.addSubview(audioImageView)
 
         contentView.addSubview(titleLab)
-
-
-
+ 
     }
 
     required init?(coder _: NSCoder) {
@@ -63,7 +61,7 @@ class MVTagsCell: UICollectionViewCell {
         if(bgmData?.isSelected ?? false){
             contentView.backgroundColor = UIColor.hexColor(hexadecimal: "#EEF0F3")
             titleLab.textColor = UIColor.hexColor(hexadecimal: "#333333")
-            contentView.addCorner()
+            contentView.addCorner(corner: 35 / 2)
             titleLab.font = UIFont.boldSystemFont(ofSize: 15)
         }else{
             contentView.backgroundColor = UIColor.clear
@@ -83,7 +81,7 @@ class MVTagsCell: UICollectionViewCell {
         }
      
         titleLab.snp.remakeConstraints { make in
-            make.left.equalTo(audioImageView.snp_right).offset(7)
+            make.left.equalTo(audioImageView.snp_right).offset(0)
             make.right.equalToSuperview().offset(-margin)
             make.centerY.equalToSuperview()
         }