summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadVPN
diff options
context:
space:
mode:
authormojganii <mojgan.jelodar@codic.se>2024-09-30 16:54:51 +0200
committerBug Magnet <marco.nikic@mullvad.net>2024-10-08 16:12:43 +0200
commitecd76bc08b4c5b30115cf585e8d140decd03acaa (patch)
treeccc2cfb8e865dee17425c96264107f9a890e6828 /ios/MullvadVPN
parent65bdbb5158242d80617dd9b40a9be33333831ce9 (diff)
downloadmullvadvpn-ecd76bc08b4c5b30115cf585e8d140decd03acaa.tar.xz
mullvadvpn-ecd76bc08b4c5b30115cf585e8d140decd03acaa.zip
Resolve shrinking collapse button problem
Diffstat (limited to 'ios/MullvadVPN')
-rw-r--r--ios/MullvadVPN/View controllers/Tunnel/ConnectionPanelView.swift20
1 files changed, 13 insertions, 7 deletions
diff --git a/ios/MullvadVPN/View controllers/Tunnel/ConnectionPanelView.swift b/ios/MullvadVPN/View controllers/Tunnel/ConnectionPanelView.swift
index a9e8f785be..937890579f 100644
--- a/ios/MullvadVPN/View controllers/Tunnel/ConnectionPanelView.swift
+++ b/ios/MullvadVPN/View controllers/Tunnel/ConnectionPanelView.swift
@@ -49,6 +49,9 @@ class ConnectionPanelView: UIView {
private let collapseView: ConnectionPanelCollapseView = {
let button = ConnectionPanelCollapseView()
+ button.axis = .horizontal
+ button.alignment = .top
+ button.distribution = .fill
button.translatesAutoresizingMaskIntoConstraints = false
button.tintColor = .white
return button
@@ -294,19 +297,22 @@ class ConnectionPanelCollapseView: UIStackView {
}()
private(set) var imageView: UIImageView = {
- return UIImageView()
+ let imageView = UIImageView()
+ imageView.contentMode = .scaleAspectFit
+ return imageView
}()
override init(frame: CGRect) {
super.init(frame: frame)
- let imageContainer = UIStackView()
- imageContainer.axis = .vertical
- imageContainer.addArrangedSubview(imageView)
- imageContainer.addArrangedSubview(UIView()) // Pushes content up.
-
addArrangedSubview(title)
- addArrangedSubview(imageContainer)
+ addArrangedSubview(imageView)
+
+ title.setContentHuggingPriority(.defaultLow, for: .horizontal)
+ title.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
+
+ imageView.setContentHuggingPriority(.defaultHigh, for: .horizontal)
+ imageView.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
addArrangedSubview(UIView()) // Pushes content left.
updateImage()