如何限制rightBarButtonItem大小在UINavigationBar? [英] How to restrict rightBarButtonItem size in UINavigationBar?

查看:103
本文介绍了如何限制rightBarButtonItem大小在UINavigationBar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用这个方法创建一个rightBarButtonItem:

I create a rightBarButtonItem with this method :

- (UIBarButtonItem *)customBarButtonWithSelector:(SEL)callback {
 UIButton *customButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
 customButton.bounds = CGRectMake(0, 0, 30.0f, 30.0f);
 return [[[UIBarButtonItem alloc] initWithCustomView:customButton] autorelease];
}

在执行时,

是否有一种方法来限制事件响应者在定义的界限或可接受的范围内?

Is there a way to restrict the event responder in the defined bounds or in a acceptable range ?

推荐答案

我在 http://osmorphis.blogspot.com/2009/05/multiple-buttons-on-navigation-bar.html
真的很有帮助,不要忘记子类UIToolBar。

I have found the solution at http://osmorphis.blogspot.com/2009/05/multiple-buttons-on-navigation-bar.html Really helpfull, don't forget to subclass UIToolBar.

这篇关于如何限制rightBarButtonItem大小在UINavigationBar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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