|
@@ -129,14 +129,20 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
addSubview(videoPlayView)
|
|
|
videoPlayView.addTapGesture(1, target: self, action: #selector(videoTapAction))
|
|
|
|
|
|
+ // 顶部渐变
|
|
|
+ addSubview(topGradientView)
|
|
|
+
|
|
|
// 顶部
|
|
|
- addSubview(navBackView)
|
|
|
+ topGradientView.addSubview(navBackView)
|
|
|
navBackView.addSubview(navBackBtn)
|
|
|
navBackView.addSubview(shareBtnRight)
|
|
|
navBackView.addSubview(shareBtnLeft)
|
|
|
|
|
|
+ // 底部渐变
|
|
|
+ addSubview(bottomGradientView)
|
|
|
+
|
|
|
// 底部
|
|
|
- addSubview(bottomCommentView)
|
|
|
+ bottomGradientView.addSubview(bottomCommentView)
|
|
|
bottomCommentView.addSubview(bottomSepView)
|
|
|
bottomCommentView.addSubview(commentBtn)
|
|
|
bottomCommentView.addSubview(collectBtn)
|
|
@@ -146,21 +152,21 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
commentView.addSubview(textBtn)
|
|
|
|
|
|
// 话题View
|
|
|
- addSubview(topicView)
|
|
|
+ bottomGradientView.addSubview(topicView)
|
|
|
|
|
|
// 视频内容
|
|
|
- addSubview(contentScrollView)
|
|
|
+ bottomGradientView.addSubview(contentScrollView)
|
|
|
contentScrollView.addSubview(contentLabel)
|
|
|
|
|
|
// 视频标题
|
|
|
- addSubview(videoTitleLabel)
|
|
|
+ bottomGradientView.addSubview(videoTitleLabel)
|
|
|
|
|
|
- addSubview(personBackView)
|
|
|
+ bottomGradientView.addSubview(personBackView)
|
|
|
personBackView.addSubview(avatarButton)
|
|
|
personBackView.addSubview(personLabel)
|
|
|
personBackView.addSubview(followButton)
|
|
|
|
|
|
- addSubview(rainbowBeanView)
|
|
|
+ bottomGradientView.addSubview(rainbowBeanView)
|
|
|
rainbowBeanView.addSubview(beanIconImageView)
|
|
|
rainbowBeanView.addSubview(beanLabel)
|
|
|
|
|
@@ -377,6 +383,29 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
return videoPlayView
|
|
|
}()
|
|
|
|
|
|
+ // MARK: 渐变View
|
|
|
+ private lazy var topGradientView: UIView = {
|
|
|
+ let topGradientView = UIView()
|
|
|
+ topGradientView.frame = CGRect(x: 0, y: 0, width: kScreenWidth, height: kSafeStatusBarHeight+60)
|
|
|
+ // 渐变层
|
|
|
+ let bgLayer1 = CAGradientLayer()
|
|
|
+ bgLayer1.frame = topGradientView.bounds
|
|
|
+ bgLayer1.rainbowLayer(gradientColors: [UIColor(hexString: "000000", alpha: 0.5).cgColor,UIColor(hexString: "000000", alpha: 0).cgColor], gradientLocations: [0,1], gradientDisplayType: .vertical, startPoint: CGPoint(x: 0.5, y: 0), endPoint: CGPoint(x: 1, y: 1))
|
|
|
+ topGradientView.layer.addSublayer(bgLayer1)
|
|
|
+ return topGradientView
|
|
|
+ }()
|
|
|
+
|
|
|
+ private lazy var bottomGradientView: UIView = {
|
|
|
+ let bottomGradientView = UIView()
|
|
|
+ bottomGradientView.frame = CGRect(x: 0, y: kScreenHeight-kSafeTabBarHeight-270, width: kScreenWidth, height: 270+kSafeTabBarHeight)
|
|
|
+ // 渐变层
|
|
|
+ let bgLayer1 = CAGradientLayer()
|
|
|
+ bgLayer1.frame = bottomGradientView.bounds
|
|
|
+ bgLayer1.rainbowLayer(gradientColors: [UIColor(hexString: "000000", alpha: 0).cgColor,UIColor(hexString: "000000", alpha: 0.8).cgColor], gradientLocations: [0,1], gradientDisplayType: .vertical, startPoint: CGPoint(x: 0.5, y: 0), endPoint: CGPoint(x: 1, y: 1))
|
|
|
+ bottomGradientView.layer.addSublayer(bgLayer1)
|
|
|
+ return bottomGradientView
|
|
|
+ }()
|
|
|
+
|
|
|
// MARK: 顶部导航View
|
|
|
private lazy var navBackView: UIView = {
|
|
|
let navBackView = UIView()
|
|
@@ -587,7 +616,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
private lazy var followButton: UIButton = {
|
|
|
let followButton = UIButton(type: UIButton.ButtonType.custom)
|
|
|
followButton.titleLabel?.font = kMediumFont13
|
|
|
- followButton.layer.cornerRadius = 11
|
|
|
+ followButton.layer.cornerRadius = 8
|
|
|
followButton.layer.masksToBounds = true
|
|
|
followButton.setTitleColor(kffffffColor, for: .normal)
|
|
|
followButton.rx.tap.subscribe(onNext: {[weak self] (data) in
|