在 UINavigationController 上创建返回箭头形状的 leftBarButtonItem [英] creating back arrow shaped leftBarButtonItem on UINavigationController

查看:17
本文介绍了在 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆