mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[ios] Fix some navigation bar buttons for iOS 26
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
committed by
Yannik Bloscheck
parent
d541cfbf02
commit
2b430c625a
@@ -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
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user