在 UINavigationController 上创建返回箭头形状的 leftBarButtonItem

2023-06-13移动开发问题
0

本文介绍了在 UINavigationController 上创建返回箭头形状的 leftBarButtonItem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有一个带有导航控制器的视图,我正在模态显示,我想添加一个形状类似于大多数 splitViewControllers 中使用的默认左箭头按钮的后退按钮.

I have a view with a navigation controller that I am showing modally and I want to add a back button that is shaped like the default left arrow buttons used in most splitViewControllers.

我可以创建一个基本按钮,但我真的想要左箭头形状 - 这是我现在拥有的:

I can create a basic button but I really want the left arrow shape - here is what i have now:

/* set title and nav bar items */
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Back To Thumbnails" style:UIBarButtonItemStylePlain target:self action:@selector(backToThumbnails:)] autorelease];

我在这里只看到了 3 个样式选项?任何建议都非常感谢!

I only saw 3 options for style here? Any suggestions are greatly appreciated!

推荐答案

不幸的是,创建这样的按钮不属于公共 API,您需要自定义 带有图像的 UIBarButton.

Unfortunately creating a button like that is not apart of the public API, you'll need to make a custom UIBarButton with an image.

这篇关于在 UINavigationController 上创建返回箭头形状的 leftBarButtonItem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

Cocos2d - 如何检查不同层中对象之间的交集
Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)...
2024-08-12 移动开发问题
8

突出显示朗读文本(在 iPhone 的故事书类型应用程序中)
Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))...
2024-08-12 移动开发问题
9

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

如何将 32 位 PNG 转换为 RGB565?
How to convert 32 bit PNG to RGB565?(如何将 32 位 PNG 转换为 RGB565?)...
2024-08-12 移动开发问题
21

正确的 cocos2d 场景重启?
Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)...
2024-08-12 移动开发问题
7