Commit 699e8138 authored by lujunye's avatar lujunye

非编辑状态,隐藏添加图片按钮

parent 5251ce27
...@@ -20,8 +20,9 @@ class AddImgCell: UITableViewCell { ...@@ -20,8 +20,9 @@ class AddImgCell: UITableViewCell {
var isEdit:Bool?{ var isEdit:Bool?{
willSet{ willSet{
isEdit = newValue isEdit = newValue
if isAllEditing {
addBtn.isHidden = !isEdit! addBtn.isHidden = !isEdit!
}
} }
} }
@IBAction func btnClick(_ sender: Any) { @IBAction func btnClick(_ sender: Any) {
...@@ -68,10 +69,19 @@ class AddImgCell: UITableViewCell { ...@@ -68,10 +69,19 @@ class AddImgCell: UITableViewCell {
let y = addBtn.frame.minY let y = addBtn.frame.minY
let h:CGFloat = addBtn.frame.size.height let h:CGFloat = addBtn.frame.size.height
if isSingle == false { if isSingle == false {
if isAllEditing {
addBtn.isHidden = false addBtn.isHidden = false
}else{
addBtn.isHidden = true
}
scrollView?.isHidden = false scrollView?.isHidden = false
scrollView?.bounces = false scrollView?.bounces = false
if arr.count < 3 { if arr.count < 3 {
if isAllEditing {
addBtn.isHidden = false
}else{
addBtn.isHidden = true
}
scrollView?.contentSize = CGSize(width: arr.count*105, height: 0) scrollView?.contentSize = CGSize(width: arr.count*105, height: 0)
scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: CGFloat(arr.count)*105, height:h) scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: CGFloat(arr.count)*105, height:h)
addBtnX.constant = (scrollView?.frame.maxX)! addBtnX.constant = (scrollView?.frame.maxX)!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment