Skip to content

Commit 1f5f93b

Browse files
authored
Fix visual issues in Posts (#24861)
2 parents bf7664b + ea56570 commit 1f5f93b

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

WordPress/Classes/ViewRelated/Post/Controllers/AbstractPostListViewController.swift

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,11 @@ class AbstractPostListViewController: UIViewController,
199199

200200
#if compiler(>=6.2)
201201
if #available(iOS 26, *) {
202-
navigationItem.preferredSearchBarPlacement = .integrated
202+
if tabBarController?.isTabBarHidden == false {
203+
navigationItem.preferredSearchBarPlacement = .integratedButton
204+
} else {
205+
navigationItem.preferredSearchBarPlacement = .integrated
206+
}
203207
}
204208
#endif
205209

@@ -852,28 +856,34 @@ class AbstractPostListViewController: UIViewController,
852856
// MARK: - Misc
853857

854858
private func showRefreshingIndicator() {
855-
guard navigationItem.titleView == nil else {
856-
return
857-
}
859+
// TODO: Design a better way to show it that doesn't affect the navigation bar
858860

859-
let spinner = UIActivityIndicatorView(style: .medium)
860-
spinner.startAnimating()
861-
spinner.tintColor = .secondaryLabel
862-
spinner.transform = .init(scaleX: 0.8, y: 0.8)
861+
if #unavailable(iOS 26) {
862+
guard navigationItem.titleView == nil else {
863+
return
864+
}
863865

864-
let titleView = UILabel()
865-
titleView.text = Strings.updating + "..."
866-
titleView.font = UIFont.preferredFont(forTextStyle: .headline)
867-
titleView.textColor = UIColor.secondaryLabel
866+
let spinner = UIActivityIndicatorView(style: .medium)
867+
spinner.startAnimating()
868+
spinner.tintColor = .secondaryLabel
869+
spinner.transform = .init(scaleX: 0.8, y: 0.8)
868870

869-
let stack = UIStackView(arrangedSubviews: [spinner, titleView])
870-
stack.spacing = 8
871+
let titleView = UILabel()
872+
titleView.text = Strings.updating + "..."
873+
titleView.font = UIFont.preferredFont(forTextStyle: .headline)
874+
titleView.textColor = UIColor.secondaryLabel
871875

872-
navigationItem.titleView = stack
876+
let stack = UIStackView(arrangedSubviews: [spinner, titleView])
877+
stack.spacing = 8
878+
879+
navigationItem.titleView = stack
880+
}
873881
}
874882

875883
private func hideRefreshingIndicator() {
876-
navigationItem.titleView = nil
884+
if #unavailable(iOS 26) {
885+
navigationItem.titleView = nil
886+
}
877887
}
878888

879889
private func setFooterHidden(_ isHidden: Bool) {

0 commit comments

Comments
 (0)