diff --git a/Loop/Views/HUDViewTableViewCell.swift b/Loop/Views/HUDViewTableViewCell.swift index 7dc949cfe7..57efeed68f 100644 --- a/Loop/Views/HUDViewTableViewCell.swift +++ b/Loop/Views/HUDViewTableViewCell.swift @@ -12,4 +12,8 @@ class HUDViewTableViewCell: UITableViewCell { @IBOutlet var hudView: StatusBarHUDView! + override func awakeFromNib() { + super.awakeFromNib() + backgroundColor = .secondarySystemBackground + } } diff --git a/Loop/Views/StatusTableView.swift b/Loop/Views/StatusTableView.swift index 6f59b1be3a..be4012a8f2 100644 --- a/Loop/Views/StatusTableView.swift +++ b/Loop/Views/StatusTableView.swift @@ -127,7 +127,7 @@ struct StatusTableView: View { var body: some View { ActionTabView { wrappedView - .ignoresSafeArea(edges: .bottom) + .ignoresSafeArea(edges: [.horizontal, .bottom]) .onChange(of: viewModel.temporaryPresetsManager.activeOverride) { _, _ in Task { await viewController.reloadData(animated: true) diff --git a/LoopUI/Views/StatusBarHUDView.swift b/LoopUI/Views/StatusBarHUDView.swift index 1d348e4fbb..aa1b7e240f 100644 --- a/LoopUI/Views/StatusBarHUDView.swift +++ b/LoopUI/Views/StatusBarHUDView.swift @@ -51,11 +51,15 @@ public class StatusBarHUDView: UIView, NibLoadable { containerView.translatesAutoresizingMaskIntoConstraints = false self.addSubview(containerView) - // Use AutoLayout to have the stack view fill its entire container. + // Fill the container, up to a phone-like width on wide displays such as iPhone Duo's inner display. + let fillWidth = containerView.widthAnchor.constraint(equalTo: widthAnchor) + fillWidth.priority = .defaultHigh NSLayoutConstraint.activate([ containerView.centerXAnchor.constraint(equalTo: centerXAnchor), containerView.centerYAnchor.constraint(equalTo: centerYAnchor), - containerView.widthAnchor.constraint(equalTo: widthAnchor), + fillWidth, + containerView.widthAnchor.constraint(lessThanOrEqualTo: widthAnchor), + containerView.widthAnchor.constraint(lessThanOrEqualToConstant: 500), containerView.heightAnchor.constraint(equalTo: heightAnchor), ])