瀏覽代碼

视频图尺寸更改

南鑫林 5 年之前
父節點
當前提交
813d0c318e

+ 3 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/PicVideo/CardContentPicVideoCollectionViewLayout.swift

@@ -145,8 +145,9 @@ class CardContentPicVideoCollectionViewLayout: UICollectionViewLayout {
             }else if cardContentPicVideoModel?.width ?? 0 == cardContentPicVideoModel?.height ?? 0 {
                 return CGRect(x: 0, y: 0, width: (kScreenWidth-28), height: (kScreenWidth-28))
             }else {
-                cellHeight = (kScreenWidth-28)*(cardContentPicVideoModel?.height ?? 0)/(cardContentPicVideoModel?.width ?? 0)
-                return CGRect(x: 0, y: 0, width: (kScreenWidth-28), height: cellHeight*3/4)
+//                cellHeight = (kScreenWidth-28)*(cardContentPicVideoModel?.height ?? 0)/(cardContentPicVideoModel?.width ?? 0)
+//                return CGRect(x: 0, y: 0, width: (kScreenWidth-28), height: cellHeight*3/4)
+                return CGRect(x: 0, y: 0, width: (kScreenWidth-28), height: (kScreenWidth-28))
             }
         }
     }

+ 2 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/PicVideo/CardContentPicVideoModel.swift

@@ -60,7 +60,8 @@ class CardContentPicVideoModel: NSObject {
             }else if width == height {
                 return (kScreenWidth-28)
             }else {
-                return (kScreenWidth-28)*height/width * 3/4
+//                return (kScreenWidth-28)*height/width * 3/4
+                return (kScreenWidth-28)
             }
         }
     }