UIBarButtonItem (UIBarButtonItem)不是iOS 7上的平面

时间:2022-09-11 07:34:47

just a quick question. I'm updating my company's app for iOS 7 and I'm running into a couple of walls. Right now, the big one is the UIBarButtonItem. When I compile my app against iOS 7 then run the app, I get the old bar buttons.

只是一个小问题。我正在更新我公司的iOS 7应用程序,我遇到了几堵墙。现在,最大的是UIBarButtonItem。当我用ios7编译我的应用程序,然后运行这个应用程序时,我得到了旧的bar按钮。

In short, my bar button looks like this:

简而言之,我的bar按钮是这样的:

UIBarButtonItem (UIBarButtonItem)不是iOS 7上的平面

Instead of just the text. The application itself was originally coded on iOS 5 so we have been updating it for the last couple of years. Btw, here's how I'm adding the button:

而不仅仅是文本。应用程序本身最初是在ios5上编写的,所以我们在过去几年一直在更新它。顺便说一句,我是这样添加按钮的:

self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonSystemItemDone target:nil action:nil];

Any suggestions or leads will be very much appreciated.

如有任何建议或线索,我们将不胜感激。

Thanks!

谢谢!

3 个解决方案

#1


8  

That doesn't look like a system button.

这看起来不像一个系统按钮。

Are you sure you are not setting a custom background to the button, maybe using the UIAppearance proxy?

你确定你没有设置一个自定义背景到按钮,也许使用UIAppearance代理?

#2


3  

maybe your have an image like background of your button'

也许你有一个像你的按钮的背景图片'

#3


3  

Try this :)

试试这个:)

UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:nil action:nil];
self.navigationItem.leftBarButtonItem = item;

#1


8  

That doesn't look like a system button.

这看起来不像一个系统按钮。

Are you sure you are not setting a custom background to the button, maybe using the UIAppearance proxy?

你确定你没有设置一个自定义背景到按钮,也许使用UIAppearance代理?

#2


3  

maybe your have an image like background of your button'

也许你有一个像你的按钮的背景图片'

#3


3  

Try this :)

试试这个:)

UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:nil action:nil];
self.navigationItem.leftBarButtonItem = item;