|
@@ -15,17 +15,42 @@ class TSDiyTextPromptElementView: TSPromptTextView, TSDiyVideoElement {
|
|
|
var param: String {
|
|
|
""
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ lazy var titleLabel: UILabel = {
|
|
|
+ let title: UILabel = .createLabel()
|
|
|
+ title.text = type.sectionTitle
|
|
|
+ title.textColor = .white.withAlphaComponent(0.8)
|
|
|
+ title.font = .font(size: 14, weight: .medium)
|
|
|
+ return title
|
|
|
+ }()
|
|
|
+
|
|
|
override init(randomTextArray: [String], textChangedBlock: @escaping (String) -> Void) {
|
|
|
super.init(randomTextArray: randomTextArray, textChangedBlock: textChangedBlock)
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ override func creatUI() {
|
|
|
+ addChildren()
|
|
|
+ super.creatUI()
|
|
|
+ }
|
|
|
+
|
|
|
override func makeConstraints() {
|
|
|
super.makeConstraints()
|
|
|
+ titleLabel.snp.remakeConstraints { make in
|
|
|
+ make.leading.equalToSuperview().offset(16)
|
|
|
+ make.top.equalToSuperview().offset(22)
|
|
|
+ }
|
|
|
+ textBgView.snp.remakeConstraints { make in
|
|
|
+ make.top.equalTo(titleLabel.snp.bottom).offset(12)
|
|
|
+ make.horizontalEdges.equalToSuperview().inset(16)
|
|
|
+ make.height.equalTo(182.0)
|
|
|
+ make.bottom.equalToSuperview()
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ func addChildren() {
|
|
|
+ contentView.addSubview(titleLabel)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@MainActor required init?(coder: NSCoder) {
|
|
|
fatalError("init(coder:) has not been implemented")
|
|
|
}
|
|
@@ -56,16 +81,16 @@ class TSDiyVideoPromptElementView: TSPromptTextView, TSDiyVideoElement {
|
|
|
}()
|
|
|
|
|
|
lazy var titleLabel: UILabel = {
|
|
|
- let title : UILabel = .createLabel()
|
|
|
+ let title: UILabel = .createLabel()
|
|
|
title.text = type.sectionTitle
|
|
|
title.textColor = .white.withAlphaComponent(0.8)
|
|
|
- title.font = .font(size: 14,weight: .medium)
|
|
|
+ title.font = .font(size: 14, weight: .medium)
|
|
|
return title
|
|
|
}()
|
|
|
|
|
|
override init(randomTextArray: [String], textChangedBlock: @escaping (String) -> Void) {
|
|
|
super.init(randomTextArray: randomTextArray, textChangedBlock: textChangedBlock)
|
|
|
- self.inspirationBtn.isHidden = true
|
|
|
+ inspirationBtn.isHidden = true
|
|
|
}
|
|
|
|
|
|
override func creatUI() {
|
|
@@ -118,7 +143,6 @@ class TSDiyVideoPromptElementView: TSPromptTextView, TSDiyVideoElement {
|
|
|
// make.bottom.equalTo(textBgView.snp.bottom).offset(-12)
|
|
|
// }
|
|
|
|
|
|
-
|
|
|
AIView.snp.remakeConstraints { make in
|
|
|
make.height.equalTo(28)
|
|
|
make.bottom.equalTo(-16)
|