iphone - 如何在 iPhone 上的 uinavigationbar 上创建信息按钮

标签 iphone cocoa-touch uinavigationbar

我见过许多应用程序在导航栏上都有一个信息按钮(字母“i”,周围有一个圆圈)。如何添加这种类型的按钮?

最佳答案

之前的答案很接近,但没有完全编译。这就是您真正想要的:

// Info button
UIButton* infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight]; 
[infoButton addTarget:self action:@selector(showInfoView:) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:infoButton];

关于iphone - 如何在 iPhone 上的 uinavigationbar 上创建信息按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1456088/

相关文章:

ios - ios录制视频时如何检测设备的移动速度

ios - 此应用无法通过在中国激活的 CallKit 功能获得批准。请进行适当的更改并重新提交此应用以供审核

ios - iOS 6.1 中的闪烁屏幕问题

uinavigationcontroller - UINavigationBar:添加具有移动效果的UILabel

objective-c - 设置 UINavigationBar 的标题

swift - 更新自定义导航栏透明图像自动布局 Iphone X?

iphone - 如何使 uitextfield 的特定区域不可编辑?

ios - 使用swift 3在tableVIew中自动选择单元格

ios - UIViewController 和 UITableViewController 有什么区别

ios - MPMoviePlayerController 只想要视频,没有音频