Reputation: 6347
This is really strange behavior and I'm only experiencing it in iOS8 iPads. I have a UIBarButtonItem that needs to go on the right side of the navigation bar. Here is my code to set the button:
UIBarButtonItem *btnAttOpen = [[UIBarButtonItem alloc] init];
[btnAttOpen setAction:@selector(addAttClick:)];
[btnAttOpen setImage:[UIImage imageNamed:@"addAtt"]];
[btnAttOpen setTarget:self];
[self.navigationItem setRightBarButtonItem:btnAttOpen];
When I do this, the btnAttOpen button appears where it should but is not clickable. It simply behaves as if it were a static image. The strangest part of this is if I replace setRightBarButtonItem: with setLeftBarButtonItem: the button behaves as intended.
This doesn't make sense to me. Has anyone seen this kind of behavior? Any ideas as to why this may be occurring? Thanks!
Upvotes: 1
Views: 85
Reputation: 1396
If something doesn't want to react appropriately to touches, often the problem is that one of the parent view's frames has incorrect size, which doesn't fully cover the child's frame.
You could check them, for example, by printing out view hierarchy in gdb: po [[UIWindow keyWindow] recursiveDescription]
Upvotes: 1