弹框速度优化、录像顶部时间文本添加红色背景框

This commit is contained in:
bluesea 2024-03-27 15:27:59 +08:00
parent 17c88b6222
commit 4a5bb77263
5 changed files with 65 additions and 48 deletions

View File

@ -174,19 +174,23 @@ class BaseVirtualController: UIViewController {
if(titleLab == nil){
titleLab = UILabel.init()
titleLab?.frame = CGRect.init(x: 0, y: StatuBar_Height, width: SCREEN_Width, height: NavBar_Height)
// titleLab?.frame = CGRect.init(x: 0, y: StatuBar_Height, width: SCREEN_Width, height: NavBar_Height)
titleLab?.textAlignment = NSTextAlignment.center
navtionImgView?.addSubview(titleLab!)
titleLab?.isUserInteractionEnabled = true
}
titleLab?.text = string
titleLab?.sizeToFit()
if((titleLab?.width)! > SCREEN_Width-100){
titleLab?.width = SCREEN_Width-100
}
// if((titleLab?.width)! > SCREEN_Width-100){
titleLab?.width = 100
// }
titleLab?.centerX = (navtionImgView?.width)! * 0.5
titleLab?.centerY = StatuBar_Height + NavBar_Height * 0.5;
titleLab?.backgroundColor = .red
titleLab?.layer.cornerRadius = 2
titleLab?.layer.masksToBounds = true
}

View File

@ -65,6 +65,7 @@ class CCSpatialShootController: BaseController {
label.alpha = 1.0
label.layer.cornerRadius = 8
label.clipsToBounds = true
label.isHidden = true
return label
}()
@ -278,7 +279,7 @@ class CCSpatialShootController: BaseController {
configureSession() //
setUI()
showTips()
// showTips()
self.view.bringSubviewToFront(navtionImgView!)
//
@ -504,13 +505,13 @@ class CCSpatialShootController: BaseController {
//MARK: -
func showTips() {
self.view.addSubview(tipsLabel)
self.view.bringSubviewToFront(tipsLabel)
UIView.animate(withDuration: 3, delay: 2.0,options: .curveEaseInOut) {
self.tipsLabel.alpha = 0
} completion: { finished in
self.tipsLabel.isHidden = true
}
// self.view.addSubview(tipsLabel)
// self.view.bringSubviewToFront(tipsLabel)
// UIView.animate(withDuration: 3, delay: 2.0,options: .curveEaseInOut) {
// self.tipsLabel.alpha = 0
// } completion: { finished in
// self.tipsLabel.isHidden = true
// }
}
func showHorizontalScreenTips() {
@ -781,7 +782,6 @@ class CCSpatialShootController: BaseController {
DispatchQueue.global().async {
// 线
//
print("Count: \(count)")
count += 1
let timeText = self.transToHourMinSec(second: count)
DispatchQueue.main.async {
@ -1076,9 +1076,9 @@ extension CCSpatialShootController: AVCaptureFileOutputRecordingDelegate {
if success {
print("空间视频生成成功")
saveVideoToLibrary(videoURL:outputVideoURL!)
DispatchQueue.main.async {
SVProgressHUD.showSuccess(withStatus: "空间视频成功保存到相册")
}
// DispatchQueue.main.async {
// SVProgressHUD.showSuccess(withStatus: "")
// }
} else if let error = error {
print("生成空间视频失败:\(error.localizedDescription)")
@ -1237,9 +1237,9 @@ extension CCSpatialShootController: AVCaptureFileOutputRecordingDelegate {
}
} else {
print("Photo saved to library successfully.")
DispatchQueue.main.async {
SVProgressHUD.showSuccess(withStatus: "空间图片成功保存到相册")
}
// DispatchQueue.main.async {
// SVProgressHUD.showSuccess(withStatus: "")
// }
}
}
}

View File

@ -44,10 +44,10 @@ class CCSpaceAlbumFliterCollectionCell: UICollectionViewCell {
let timeLabel: UILabel = {
let label = UILabel()
label.textColor = .white
label.backgroundColor = UIColor(hexString: "#383739")
label.backgroundColor = UIColor(hexString: "#000000",alpha:0.7)
label.textAlignment = .center
label.font = UIFont.boldSystemFont(ofSize: 12)
label.layer.cornerRadius = 8
label.layer.cornerRadius = 2
label.adjustsFontSizeToFitWidth = true
label.layer.masksToBounds = true
return label
@ -84,8 +84,8 @@ class CCSpaceAlbumFliterCollectionCell: UICollectionViewCell {
frameCountLabel.widthAnchor.constraint(equalToConstant: 40),
frameCountLabel.heightAnchor.constraint(equalToConstant: 20),
timeLabel.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -8),
timeLabel.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -8),
timeLabel.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -4),
timeLabel.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -4),
timeLabel.widthAnchor.constraint(equalToConstant: 40),
timeLabel.heightAnchor.constraint(equalToConstant: 20)
])
@ -200,7 +200,8 @@ class CCSpaceAlbumFilterPopView2: UIView {
sbtn.addTarget(self, action: #selector(filterAction(btn:)), for: .valueChanged)
sbtn.setTitleTextAttributes([NSAttributedString.Key.foregroundColor:UIColor.white], for: .normal)
sbtn.setTitleTextAttributes([NSAttributedString.Key.foregroundColor:UIColor.black], for: .selected)
sbtn.selectedSegmentIndex = 0;
sbtn.selectedSegmentIndex = 0
sbtn.selectedSegmentTintColor = UIColor(red: 165.0/255, green: 137.0/255, blue: 1, alpha: 1)
return sbtn
}()
@ -450,7 +451,7 @@ extension CCSpaceAlbumFilterPopView2:UICollectionViewDataSource, UICollectionVie
if model.assetType == .image {
cell.frameCountLabel.text = "空间"
cell.frameCountLabel.isHidden = false
cell.frameCountLabel.isHidden = true
cell.timeLabel.isHidden = true
}else if model.assetType == .video {

View File

@ -42,34 +42,37 @@ class CCBottomMenuCell: UITableViewCell {
self.backgroundColor = .clear
//
self.contentView.addSubview(titleLabel)
self.contentView.addSubview(iconImageView)
// self.contentView.addSubview(arrowImageView)
titleLabel.snp.makeConstraints { (make) in
make.centerY.equalTo(self.contentView.snp.centerY)
make.centerX.equalTo(self.contentView.snp.centerX)
let bgView = UIView()
self.contentView.addSubview(bgView)
bgView.snp.makeConstraints { make in
make.top.bottom.equalTo(self)
make.centerX.equalTo(self)
}
//
bgView.addSubview(titleLabel)
bgView.addSubview(iconImageView)
titleLabel.snp.makeConstraints { (make) in
make.top.equalTo(bgView.snp.top)
make.bottom.equalTo(bgView.snp.bottom)
make.trailing.equalTo(bgView.snp.trailing)
}
titleLabel.font = UIFont.systemFont(ofSize: 16)
//
iconImageView.snp.makeConstraints { (make) in
make.centerY.equalTo(self.contentView.snp.centerY)
make.centerY.equalTo(bgView.snp.centerY)
make.trailing.equalTo(titleLabel.snp.leading).offset(-10)
make.width.equalTo(32)
make.height.equalTo(32)
make.leading.equalTo(bgView.snp.leading)
}
// arrowImageView.snp.makeConstraints { (make) in
// make.centerY.equalTo(self.contentView.snp.centerY)
// make.trailing.equalTo(self.contentView.snp.trailing).offset(KHZSize(-20))
// make.width.equalTo(KHZSize(6))
// make.height.equalTo(KHZSize(10))
//
// }
}
required init?(coder: NSCoder) {

View File

@ -46,7 +46,7 @@ class CCBottomMenuPopView: UIView,UITableViewDelegate, UITableViewDataSource {
tableView.delegate = self
tableView.dataSource = self
tableView.register(CCBottomMenuCell.self, forCellReuseIdentifier: OtherCellId)
tableView.isScrollEnabled = false
//线
tableView.separatorStyle = .none
@ -91,7 +91,7 @@ class CCBottomMenuPopView: UIView,UITableViewDelegate, UITableViewDataSource {
//tableView
CCBottomMenuPopView.share.Back_Height = CCBottomMenuPopView.share.Cell_Height*CGFloat(textArray.count)+CCBottomMenuPopView.share.HeaderView_Height+CCBottomMenuPopView.share.Cell_Height
UIView.animate(withDuration: 0.5, animations: {
UIView.animate(withDuration: 0.25, animations: {
CCBottomMenuPopView.share.listTableView.alpha = 1.0
CCBottomMenuPopView.share.listTableView.frame = CGRect.init(x: 0, y: KScreenHeight - CCBottomMenuPopView.share.Back_Height, width: KScreenWidth, height: CCBottomMenuPopView.share.Back_Height)
@ -138,11 +138,13 @@ class CCBottomMenuPopView: UIView,UITableViewDelegate, UITableViewDataSource {
@objc func hide() {
UIView.animate(withDuration: 0.5, animations: { [self] in
UIView.animate(withDuration: 0.25, animations: { [self] in
self.listTableView.alpha = 0
self.alpha = 0
self.listTableView.frame = CGRect.init(x: 0, y: KScreenHeight + 10 , width: KScreenWidth, height: Back_Height)
}) { (isFinished) in
self.removeFromSuperview()
self.alpha = 1
}
}
@ -192,12 +194,19 @@ class CCBottomMenuPopView: UIView,UITableViewDelegate, UITableViewDataSource {
cell?.iconImageView.isHidden = false
let imageStr:String = imageArray[indexPath.row]
cell?.iconImageView.image = UIImage.init(named: imageStr)
cell?.iconImageView.snp.updateConstraints { make in
make.width.equalTo(32)
}
}
}else if indexPath.section == 1
{
cell?.titleLabel.text = "取消"
cell?.iconImageView.isHidden = true
cell?.iconImageView.image = nil
cell?.iconImageView.snp.updateConstraints { make in
make.width.equalTo(0)
}
}
return cell!