How can I use the pointy back button for my own buttons/navbar items?

时间:2022-11-02 20:57:31

As I'm sure you know, navbars inside a navigation controller stack get a back button that shaped sort of like an arrow with a pointy end on the left. I want to use this button image for my own uibuttons and navbar items, but it's missing from from the attribute inspector > bar item > image drop down menu. Where is this graphic located and how can I use it?

我相信你知道,导航控制器堆栈中的导航栏会得到一个后退按钮,其形状类似于左侧有尖端的箭头。我想将此按钮图像用于我自己的uibuttons和导航栏项目,但是它从属性检查器> bar项目>图像下拉菜单中丢失了。这个图形在哪里,我该如何使用它?

here's a screen of the button to which I refer: How can I use the pointy back button for my own buttons/navbar items?

这是我所指的按钮的屏幕:

1 个解决方案

#1


3  

If you want to do this programatically -

如果你想以编程方式执行此操作 -

UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithImage:yourImage style:UIBarButtonItemStyleBordered target:nil action:nil];
self.navigationItem.backBarButtonItem = button;
[button release];

You can use like below in xib-

你可以在下面使用xib-

How can I use the pointy back button for my own buttons/navbar items?

#1


3  

If you want to do this programatically -

如果你想以编程方式执行此操作 -

UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithImage:yourImage style:UIBarButtonItemStyleBordered target:nil action:nil];
self.navigationItem.backBarButtonItem = button;
[button release];

You can use like below in xib-

你可以在下面使用xib-

How can I use the pointy back button for my own buttons/navbar items?