Pārlūkot izejas kodu

添加阴影效果

jsonwang 3 gadi atpakaļ
vecāks
revīzija
ae4c8c4645

+ 8 - 0
BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift

@@ -279,6 +279,10 @@ public class BFRecordScreenController: BFBaseViewController {
         let btn = UIButton(type: .custom)
         btn.setBackgroundImage(imageInRecordScreenKit(by: "subtitleBtn_on"), for: .normal)
         btn.addTarget(self, action: #selector(subTitleClick), for: .touchUpInside)
+        btn.layer.shadowColor = UIColor.black.cgColor;
+        btn.layer.shadowOffset = CGSize.init(width: 0, height: 1.5)
+        btn.layer.shadowRadius = 3;
+        btn.layer.shadowOpacity = 0.3;
         btn.setTitle("function_subtitle".BFLocale, for: .normal)
         btn.titleLabel?.font = UIFont.systemFont(ofSize: 12, weight: .medium)
         btn.imagePosition(at: PQButtonImageEdgeInsetsStyle.top, space:10)
@@ -294,6 +298,10 @@ public class BFRecordScreenController: BFBaseViewController {
         btn.setTitleColor(UIColor.white, for: .normal)
         btn.setTitle("function_voice".BFLocale, for: .normal)
         btn.titleLabel?.font = UIFont.systemFont(ofSize: 12, weight: .medium)
+        btn.layer.shadowColor = UIColor.black.cgColor;
+        btn.layer.shadowOffset = CGSize.init(width: 0, height: 1.5)
+        btn.layer.shadowRadius = 3;
+        btn.layer.shadowOpacity = 0.3;
         btn.imagePosition(at: PQButtonImageEdgeInsetsStyle.top, space:10)
         btn.titleLabel?.adjustsFontSizeToFitWidth = true
         return btn