|
@@ -19,27 +19,39 @@ public let cUserProtocol = "https://weapppiccdn.yishihui.com/resources/agreement
|
|
|
public let cPrivacy = "https://weapppiccdn.yishihui.com/resources/agreements/shishuo/videoagreement.html?type=20"
|
|
|
|
|
|
class INRecorderController: BFBaseViewController {
|
|
|
- lazy var photoBtn: UIButton = {
|
|
|
- let btn = UIButton(type: .custom)
|
|
|
- btn.setImage(UIImage(named: "add"), for: .normal)
|
|
|
- btn.setTitle("从相册选择", for: .normal)
|
|
|
- btn.titleLabel?.font = UIFont.systemFont(ofSize: 14)
|
|
|
- btn.addTarget(self, action: #selector(addVideo), for: .touchUpInside)
|
|
|
- btn.imageEdgeInsets = UIEdgeInsets(top: -btn.imageView!.height, left: 0, bottom: 0, right: -btn.titleLabel!.width)
|
|
|
- btn.titleEdgeInsets = UIEdgeInsets(top: btn.titleLabel!.height + 2, left: -btn.imageView!.width, bottom: 0, right: 0)
|
|
|
- return btn
|
|
|
+
|
|
|
+ lazy var titleL : UILabel = {
|
|
|
+ let l = UILabel()
|
|
|
+ l.text = "开始讲解"
|
|
|
+ l.textAlignment = .center
|
|
|
+ l.textColor = .white
|
|
|
+ l.font = UIFont.systemFont(ofSize: 36)
|
|
|
+
|
|
|
+ return l
|
|
|
}()
|
|
|
|
|
|
lazy var camaraBtn: UIButton = {
|
|
|
let btn = UIButton(type: .custom)
|
|
|
btn.setImage(UIImage(named: "add"), for: .normal)
|
|
|
btn.setTitle("拍摄录制", for: .normal)
|
|
|
+ btn.setTitleColor(UIColor.init(white: 1, alpha: 0.5), for: .normal)
|
|
|
btn.titleLabel?.font = UIFont.systemFont(ofSize: 14)
|
|
|
btn.addTarget(self, action: #selector(cameraBtnAction), for: .touchUpInside)
|
|
|
|
|
|
return btn
|
|
|
}()
|
|
|
|
|
|
+ lazy var photoBtn: UIButton = {
|
|
|
+ let btn = UIButton(type: .custom)
|
|
|
+ btn.setImage(UIImage(named: "add"), for: .normal)
|
|
|
+ btn.setTitle("从相册选择", for: .normal)
|
|
|
+ btn.setTitleColor(UIColor.init(white: 1, alpha: 0.5), for: .normal)
|
|
|
+ btn.titleLabel?.font = UIFont.systemFont(ofSize: 14)
|
|
|
+ btn.addTarget(self, action: #selector(addVideo), for: .touchUpInside)
|
|
|
+
|
|
|
+ return btn
|
|
|
+ }()
|
|
|
+
|
|
|
lazy var bgView:UIImageView = {
|
|
|
let bgView = UIImageView.init(frame: CGRect.init(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth))
|
|
|
bgView.contentMode = .scaleAspectFill
|
|
@@ -187,16 +199,19 @@ class INRecorderController: BFBaseViewController {
|
|
|
view.addSubview(buildTimeLabel)
|
|
|
}
|
|
|
|
|
|
- view.addSubview(centerView)
|
|
|
view.addSubview(bottomView)
|
|
|
+
|
|
|
+ view.addSubview(centerView)
|
|
|
centerView.snp.makeConstraints { make in
|
|
|
make.width.equalToSuperview()
|
|
|
make.height.equalTo(209)
|
|
|
make.center.equalToSuperview()
|
|
|
}
|
|
|
|
|
|
+ centerView.addSubview(titleL)
|
|
|
centerView.addSubview(camaraBtn)
|
|
|
centerView.addSubview(photoBtn)
|
|
|
+
|
|
|
camaraBtn.snp.makeConstraints { make in
|
|
|
make.width.equalTo(130)
|
|
|
make.height.equalTo(180)
|
|
@@ -209,23 +224,9 @@ class INRecorderController: BFBaseViewController {
|
|
|
make.width.height.centerY.equalTo(camaraBtn)
|
|
|
}
|
|
|
|
|
|
- let l = UILabel()
|
|
|
- l.text = "选择视频/图片\n开始讲解"
|
|
|
- l.textColor = UIColor.hexColor(hexadecimal: "#8C9399")
|
|
|
- l.font = UIFont.systemFont(ofSize: 17)
|
|
|
- centerView.addSubview(l)
|
|
|
- let text = l.text
|
|
|
- let attributedString = NSMutableAttributedString.init(string: text!)
|
|
|
- let paragraphStyle = NSMutableParagraphStyle()
|
|
|
- paragraphStyle.lineSpacing = 7
|
|
|
- paragraphStyle.alignment = .center
|
|
|
- attributedString.addAttribute(.paragraphStyle, value: paragraphStyle, range: .init(location: 0, length: l.text?.count ?? 0))
|
|
|
-
|
|
|
- l.attributedText = attributedString
|
|
|
- l.sizeToFit()
|
|
|
- l.numberOfLines = 2
|
|
|
- l.snp.makeConstraints { make in
|
|
|
- make.bottom.equalTo(photoBtn.snp.top).offset(-5)
|
|
|
+
|
|
|
+ titleL.snp.makeConstraints { make in
|
|
|
+ make.bottom.equalTo(photoBtn.snp.top).offset(-50)
|
|
|
make.centerX.equalToSuperview()
|
|
|
make.width.equalTo(200)
|
|
|
make.height.equalTo(40)
|