From 1ac0bd65bea658f656b5a96c0526cd6caf30d5a3 Mon Sep 17 00:00:00 2001 From: CMK Date: Thu, 10 Feb 2022 14:22:14 +0800 Subject: [PATCH] fix: add missing shadow for compose publish button --- Mastodon/Scene/Compose/ComposeViewController.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Mastodon/Scene/Compose/ComposeViewController.swift b/Mastodon/Scene/Compose/ComposeViewController.swift index 8bff75b9e..04687ca5d 100644 --- a/Mastodon/Scene/Compose/ComposeViewController.swift +++ b/Mastodon/Scene/Compose/ComposeViewController.swift @@ -53,7 +53,16 @@ final class ComposeViewController: UIViewController, NeedsDependency { }() private(set) lazy var publishBarButtonItem: UIBarButtonItem = { configurePublishButtonApperance() - let barButtonItem = UIBarButtonItem(customView: publishButton) + let shadowBackgroundContainer = ShadowBackgroundContainer() + publishButton.translatesAutoresizingMaskIntoConstraints = false + shadowBackgroundContainer.addSubview(publishButton) + NSLayoutConstraint.activate([ + publishButton.topAnchor.constraint(equalTo: shadowBackgroundContainer.topAnchor), + publishButton.leadingAnchor.constraint(equalTo: shadowBackgroundContainer.leadingAnchor), + publishButton.trailingAnchor.constraint(equalTo: shadowBackgroundContainer.trailingAnchor), + publishButton.bottomAnchor.constraint(equalTo: shadowBackgroundContainer.bottomAnchor), + ]) + let barButtonItem = UIBarButtonItem(customView: shadowBackgroundContainer) return barButtonItem }()