[ios] Fix some navigation bar buttons for iOS 26

Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
Yannik Bloscheck
2025-09-04 13:12:19 +02:00
committed by Yannik Bloscheck
parent d541cfbf02
commit 2b430c625a
2 changed files with 2 additions and 6 deletions

View File

@@ -17,11 +17,7 @@ static CGFloat const kButtonExtraWidth = 16.0;
- (UIBarButtonItem *)buttonWithImage:(UIImage *)image action:(SEL)action - (UIBarButtonItem *)buttonWithImage:(UIImage *)image action:(SEL)action
{ {
UIButton * button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, image.size.width + kButtonExtraWidth, image.size.height)]; return [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:self action:action];
[button setImage:image forState:UIControlStateNormal];
[button matchInterfaceOrientation];
[button addTarget:self action:action forControlEvents:UIControlEventTouchUpInside];
return [[UIBarButtonItem alloc] initWithCustomView:button];
} }
- (NSArray<UIBarButtonItem *> *)alignedNavBarButtonItems:(NSArray<UIBarButtonItem *> *)items - (NSArray<UIBarButtonItem *> *)alignedNavBarButtonItems:(NSArray<UIBarButtonItem *> *)items

View File

@@ -80,7 +80,7 @@ class DownloadMapsViewController: MWMViewController {
tableView.registerNib(cell: MWMMapDownloaderButtonTableViewCell.self) tableView.registerNib(cell: MWMMapDownloaderButtonTableViewCell.self)
title = dataSource.title title = dataSource.title
if mode == .downloaded { if mode == .downloaded {
let addMapsButton = button(with: UIImage(named: "ic_nav_bar_add"), action: #selector(onAddMaps)) let addMapsButton = button(with: UIImage(systemName: "plus"), action: #selector(onAddMaps))
navigationItem.rightBarButtonItem = addMapsButton navigationItem.rightBarButtonItem = addMapsButton
} }
noMapsContainer.isHidden = !dataSource.isEmpty || Storage.shared().downloadInProgress() noMapsContainer.isHidden = !dataSource.isEmpty || Storage.shared().downloadInProgress()