Parcourir la source

设置字幕背景色

jsonwang il y a 3 ans
Parent
commit
b49277ca4b

+ 2 - 1
BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift

@@ -513,7 +513,7 @@ public class BFRecordScreenController: BFBaseViewController {
             }
         }
         if findShowSubtitle != nil, subtitleSettingView.subtitle.setting.subtitleIsShow {
-            subtitleLabel.text = findShowSubtitle?.text
+            subtitleLabel.text = findShowSubtitle?.text ?? ""
             setSubtitleStyle(settingModel: subtitleSettingView.subtitle.setting)
 
         } else {
@@ -535,6 +535,7 @@ public class BFRecordScreenController: BFBaseViewController {
 
             let height = sizeTextFits(attributedText: nil, text: subtitleLabel.text ?? "", numberOfLines: 0, font: subtitleLabel.font, maxSize: CGSize(width: cScreenWidth - leftPoint * 2, height: CGFloat.greatestFiniteMagnitude)).height
 
+            subtitleLabel.backgroundColor = subtitleSettingView.subtitle.setting.backgroundColor
             // 下 //设置位置
             if subtitleSettingView.subtitle.setting.subtitlePoint == 0 {
                 subtitleLabel.frame = CGRect(x: leftPoint, y: cScreenHeigth * 0.70 - height, width: cScreenWidth - 37 * 2, height: height)