Rom*_*anS 2 objective-c uinavigationbar
我创建了这样的自定义导航按钮:
UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setImage:[UIImage imageNamed:@"some.png"] forState:UIControlStateNormal];
....
[[current navigationItem] setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithCustomView:button]];
Run Code Online (Sandbox Code Playgroud)
其中current是UIViewController*类型.一切正常,按钮创建,但它是按钮外的可点击区域,非常靠近导航栏的中间.是否可以限制可点击区域?
我相信这是iOS的"功能".左侧和右侧的导航按钮小于iOS中允许的最小触摸区域.因此,实际命中区域比物理NavigationButton大得多.包括在酒吧下面,就像你注意到按钮的左右两侧.它允许快速触摸,而无需"看"你触摸的地方.其中一个关键原因是iPhone在早期使用比大多数Android手机更自然.