Browse Source

Merge branch 'dev' of https://git.yishihui.com/iOS/MusicVideoPlus into dev

wenweiwei 3 years ago
parent
commit
7a58856b93
1 changed files with 8 additions and 3 deletions
  1. 8 3
      MusicVideoPlus/Classes/Modules/Home/Views/MVBannerCell.swift

+ 8 - 3
MusicVideoPlus/Classes/Modules/Home/Views/MVBannerCell.swift

@@ -160,14 +160,17 @@ class MVBannerCell: UICollectionViewCell {
         typeLab.text = "\(videoData?.categoryName ?? "")"
         BFLog(message: "videoDatavideoData \(String(describing: videoData?.title))")
         
+        let boundingRect : CGRect = (videoData?.title?.boundingRect(with: CGSize(width: 200, height: 0), options: .usesLineFragmentOrigin, attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 16, weight: .bold)], context: nil)) ?? CGRect.init()
+        
         titleLabel.snp.remakeConstraints { make in
-//            make.width.equalTo(cScreenWidth - 80)
             make.right.equalTo(reCreateBtn.snp_right)
-            make.height.equalTo(videoData?.titleH ?? 0)
+            make.height.equalTo(boundingRect.height)
             make.left.equalToSuperview().offset(12)
             make.bottom.equalTo(musicContenView.snp_top).offset(-cDefaultMargin)
         }
+        BFLog(message: "videoData?.title is \(String(describing: videoData?.title))")
         titleLabel.text = videoData?.title ?? ""
+   
 
         
         if videoData?.categoryImage != nil {
@@ -208,10 +211,12 @@ class MVBannerCell: UICollectionViewCell {
             make.height.equalTo(82)
             make.center.equalToSuperview()
         }
+        
+        
 
         bottmMaskView.snp.remakeConstraints { make in
             make.width.equalToSuperview()
-            make.height.equalTo(150)
+            make.height.equalTo(150 + 100)
             make.left.equalToSuperview()
             make.bottom.equalToSuperview()
         }