【发布时间】:2010-06-03 04:03:29
【问题描述】:
情况:我正在将一个系统“项目操作”按钮的实例放入右侧导航按钮槽中......那里没有问题。但是,我希望该按钮仅显示为没有边框的图标(即:“普通”样式)。阅读文档,听起来这应该很简单,只需将 UIBarButtonItem 的“样式”属性设置为 UIBarButtonItemStylePlain,如下所示:
UIBarButtonItem *shareButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(didPressShare)];
shareButton.style = UIBarButtonItemStylePlain;
self.navigationItem.rightBarButtonItem = shareButton;
[shareButton release];
但是,当我实现上面的代码时,按钮出现在导航栏中,周围有一个边框......显然系统没有观察我的 UIBarButtonItemStylePlain 设置。关于为什么的任何想法?是否有任何其他解决方案可以使按钮仅显示图标而周围没有边框?
提前致谢!
【问题讨论】:
标签: iphone objective-c