gpt4 book ai didi

ios - 升级到 iOS 11 后 UiNavigationbar 按钮无响应

转载 作者:行者123 更新时间:2023-11-28 17:49:30 24 4
gpt4 key购买 nike

升级到 iOS 11 和 XCode9 后,我的应用程序的 NavigationBar 按钮(左侧和右侧)没有响应。它在以前的版本中运行良好,但在 iOS 11 中运行不佳。任何人都可以帮助我或遇到同样的问题。我的应用程序是用 Objective c 语言编写的。

**//here is code for leftbarbutton**

UIImage *backSVG = [UIImage imageWithSVGNamed:@"backarrow32" targetSize:CGSizeMake(25, 25) fillColor:[UIColor whiteColor]];

UIBarButtonItem *notifyButton = [[UIBarButtonItem alloc] initWithImage:backSVG style:UIBarButtonItemStylePlain target:self action:@selector(handleBackButton)];

[notifyButton setStyle:UIBarButtonItemStylePlain];

self.navigationItem.leftBarButtonItem = notifyButton;

**//Rightbar buttons are**

UIBarButtonItem *rightbar1 = [[UIBarButtonItem alloc] initWithImage:
[UIImage imageWithSVGNamed:@"rightbar1" targetSize:CGSizeMake(21, 21)
fillColor:[UIColor whiteColor]] style:UIBarButtonItemStylePlain target:self
action:nil];

[rightbar1 setAction:@selector(handlerightbar1Action)];

UIBarButtonItem *rightbar2 = [[UIBarButtonItem alloc] initWithImage:
[UIImage imageWithSVGNamed:@"rightbar2" targetSize:CGSizeMake(21, 21)
fillColor:[UIColor whiteColor]] style:UIBarButtonItemStylePlain
target:self action:nil];

[rightbar2 setAction:@selector(handlerightbar2Action)];

[rightbar1 setImageInsets:UIEdgeInsetsMake(0, -30, 0, -50)];

self.navigationItem.rightBarButtonItems = [NSArray
arrayWithObjects:rightbar2, rightbar1, nil];

最佳答案

这个导航栏是您在界面构建器中添加的还是来自导航 Controller (推送或 Root View Controller )?

如果您可以附加来自界面生成器的 UI View Controller 的图像,它将提供问题的更多详细信息。

关于ios - 升级到 iOS 11 后 UiNavigationbar 按钮无响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46774472/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com