Remove cancel button from attachment caption view.

pull/2/head
Matthew Chen 5 years ago
parent cea361705e
commit fb6631df5f

@ -75,11 +75,6 @@ class AttachmentCaptionViewController: OWSViewController {
configureTextView()
let cancelButton = UIBarButtonItem(barButtonSystemItem: .cancel,
target: self,
action: #selector(didTapCancel))
cancelButton.tintColor = .white
navigationItem.leftBarButtonItem = cancelButton
let doneIcon = UIImage(named: "image_editor_checkmark_full")?.withRenderingMode(.alwaysTemplate)
let doneButton = UIBarButtonItem(image: doneIcon, style: .plain,
target: self,
@ -96,7 +91,6 @@ class AttachmentCaptionViewController: OWSViewController {
stackView.axis = .vertical
stackView.spacing = 20
stackView.alignment = .fill
stackView.addBackgroundView(withBackgroundColor: UIColor(white: 0, alpha: 0.5))
stackView.layoutMargins = UIEdgeInsets(top: 16, left: 20, bottom: 16, right: 20)
stackView.isLayoutMarginsRelativeArrangement = true
self.view.addSubview(stackView)
@ -104,6 +98,15 @@ class AttachmentCaptionViewController: OWSViewController {
stackView.autoPinEdge(toSuperviewEdge: .trailing)
self.autoPinView(toBottomOfViewControllerOrKeyboard: stackView, avoidNotch: true)
let backgroundView = UIView()
backgroundView.backgroundColor = UIColor(white: 0, alpha: 0.5)
view.addSubview(backgroundView)
view.sendSubview(toBack: backgroundView)
backgroundView.autoPinEdge(toSuperviewEdge: .leading)
backgroundView.autoPinEdge(toSuperviewEdge: .trailing)
backgroundView.autoPinEdge(toSuperviewEdge: .bottom)
backgroundView.autoPinEdge(.top, to: .top, of: stackView)
let minTextHeight: CGFloat = textView.font?.lineHeight ?? 0
textViewHeightConstraint = textView.autoSetDimension(.height, toSize: minTextHeight)

Loading…
Cancel
Save