修复:
1.动态获取空间图片的大小、尺寸
This commit is contained in:
parent
e2e16046ef
commit
b5ebe769f1
@ -86,9 +86,13 @@ class VRPhotoTransformController: BaseController {
|
|||||||
print("这不是一张空间图片")
|
print("这不是一张空间图片")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
let imgWidth:CGFloat = mImgView?.image?.size.width ?? 0.0
|
||||||
|
let imgHeight:CGFloat = mImgView?.image?.size.height ?? 0.0
|
||||||
|
let imgSize:Int = sourceImageData?.count ?? 0
|
||||||
|
// size 表示数据的大小,单位为字节
|
||||||
|
let imgMbSize = Double(imgSize) / 1024 / 1024
|
||||||
|
let imgTitle = sourceImageURL?.pathComponents.last ?? "xx"
|
||||||
mBottomBtn = UIButton.init(type: UIButton.ButtonType.custom)
|
mBottomBtn = UIButton.init(type: UIButton.ButtonType.custom)
|
||||||
self.view.addSubview(mBottomBtn!)
|
self.view.addSubview(mBottomBtn!)
|
||||||
mBottomBtn!.backgroundColor = UIColor.hexStringToColor(hexString: "#5326D6")
|
mBottomBtn!.backgroundColor = UIColor.hexStringToColor(hexString: "#5326D6")
|
||||||
@ -130,7 +134,8 @@ class VRPhotoTransformController: BaseController {
|
|||||||
mCenLab2!.textColor = UIColor.hexStringToColor(hexString: "#67617A")
|
mCenLab2!.textColor = UIColor.hexStringToColor(hexString: "#67617A")
|
||||||
mCenLab2!.font = UIFont.systemFont(ofSize: 12)
|
mCenLab2!.font = UIFont.systemFont(ofSize: 12)
|
||||||
mCenView!.addSubview(mCenLab2!)
|
mCenView!.addSubview(mCenLab2!)
|
||||||
mCenLab2!.text = "00:00:03 · 10.9 MB"
|
mCenLab2!.text = "\(imgWidth) x \(imgHeight) · \(imgMbSize)"
|
||||||
|
mCenLab2!.text = String(format: "%.f x %.f · %.1f MB",imgWidth,imgHeight,imgMbSize)
|
||||||
mCenLab2!.sizeToFit()
|
mCenLab2!.sizeToFit()
|
||||||
if(mCenLab2!.width > mCenView!.width - 140){
|
if(mCenLab2!.width > mCenView!.width - 140){
|
||||||
mCenLab2!.width = mCenView!.width - 140
|
mCenLab2!.width = mCenView!.width - 140
|
||||||
@ -149,7 +154,7 @@ class VRPhotoTransformController: BaseController {
|
|||||||
mCenBtn!.right = mCenView!.width - 16
|
mCenBtn!.right = mCenView!.width - 16
|
||||||
mCenBtn!.clipsToBounds = true
|
mCenBtn!.clipsToBounds = true
|
||||||
mCenBtn!.layer.cornerRadius = 10
|
mCenBtn!.layer.cornerRadius = 10
|
||||||
mCenBtn!.setTitle("MV-HEVC", for: UIControl.State.normal)
|
mCenBtn!.setTitle("Spatial Photo", for: UIControl.State.normal)
|
||||||
mCenBtn!.setTitleColor(UIColor.white, for: UIControl.State.normal)
|
mCenBtn!.setTitleColor(UIColor.white, for: UIControl.State.normal)
|
||||||
mCenBtn!.titleLabel?.font = UIFont.systemFont(ofSize: 12)
|
mCenBtn!.titleLabel?.font = UIFont.systemFont(ofSize: 12)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user