소스 검색

设置圆角

jsonwang 3 년 전
부모
커밋
d8b763d7f3

+ 8 - 2
BFRecordScreenKit/Classes/RecordScreen/View/BFAudioSettingView.swift

@@ -16,7 +16,8 @@ class BFAudioSettingView: UIView {
 
     var callBack: BFAudioSettingViewCallBack?
     
-    
+    //操作板背景
+    let backView = UIView.init()
     // 标题
     public lazy var haveSpeakLab: UILabel = {
         let haveSpeakLab = UILabel()
@@ -85,7 +86,7 @@ class BFAudioSettingView: UIView {
         self.backgroundColor = UIColor.clear
         addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(hidden)))
         
-        let backView = UIView.init()
+       
         backView.backgroundColor = .black
         addSubview(backView)
         backView.snp.makeConstraints { make in
@@ -125,6 +126,11 @@ class BFAudioSettingView: UIView {
         }
     }
     
+    override func layoutSubviews() {
+        super.layoutSubviews()
+        self.backView.addCorner(roundingCorners: [.topLeft, .topRight], corner: 10)
+    }
+    
     required init?(coder: NSCoder) {
         fatalError("init(coder:) has not been implemented")
     }

+ 10 - 5
BFRecordScreenKit/Classes/RecordScreen/View/BFSubtitleSettingView.swift

@@ -30,6 +30,9 @@ class BFSubtitleSettingView: UIView {
 
     // 样式配置
     var styleConfig: [Int: [String: Any]] = Dictionary()
+    
+    //操作板背景
+    let backView = UIButton()
 
     override init(frame: CGRect) {
         super.init(frame: frame)
@@ -37,7 +40,6 @@ class BFSubtitleSettingView: UIView {
         backgroundColor = UIColor.clear
         addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(hidden)))
 
-        let backView = UIButton()
         backView.backgroundColor = .black
 
         addSubview(backView)
@@ -47,6 +49,7 @@ class BFSubtitleSettingView: UIView {
             make.width.equalTo(cScreenWidth)
             make.height.equalTo(220)
         }
+        backView.setNeedsUpdateConstraints()
 
         styleConfig = [0: ["fontColor": UIColor.hexColor(hexadecimal: "#FFCF53"), "backgroundColor": UIColor.clear, "strokeColor": UIColor.black, "backgroundAlpha": 0.0],
                        1: ["fontColor": UIColor.hexColor(hexadecimal: "#FF9292"), "backgroundColor": UIColor.clear, "strokeColor": UIColor.black, "backgroundAlpha": 0.0],
@@ -186,10 +189,12 @@ class BFSubtitleSettingView: UIView {
             make.right.equalToSuperview().offset(-18)
             make.top.equalTo(line.snp.top).offset(13)
         }
-
-        //        addCorner(roundingCorners: .topLeft, corner: 10)
-        //        addCorner(roundingCorners: .topRight, corner: 10)
-        BFLog(message: "")
+ 
+    }
+    
+    override func layoutSubviews() {
+        super.layoutSubviews()
+        self.backView.addCorner(roundingCorners: [.topLeft, .topRight], corner: 10)
     }
 
     @objc func hidden() {