在UINavigationController上创建后箭头形状leftBarButtonItem [英] creating back arrow shaped leftBarButtonItem on UINavigationController
问题描述
我有一个导航控制器的视图,我以模态方式显示,我想添加一个形状类似于大多数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屋!