Smaller active area for custom UIBarButtonItem
问题 I have a UINavigationBar with a custom UIBarButtonItem (which uses a UIButton as its custom view). The problem is: the active area of the custom button is much too large, if I tap at least 40 pixels outside the button, it still gets registered as a tap on the button. This results in accidental taps. How can I reduce the active area on these buttons? 回答1: I noticed this weirdness too. I found that using a container UIView fixes this. For example: UIButton *menuButton = [[UIButton alloc]