Created
August 16, 2014 09:30
-
-
Save taktamur/eabe5ca9f8f4aeb9314a to your computer and use it in GitHub Desktop.
メモ:UINavigationBarの当たり判定が下にはみ出す、その理由 ref: http://qiita.com/paming/items/ab582d5c1d61794e7433
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @interface HitTestNavigationBar : UINavigationBar | |
| @end | |
| @implementation HitTestNavigationBar | |
| - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event | |
| { | |
| NSLog( @"hitTest point.y=%.1f",point.y); | |
| if ([self pointInside:point withEvent:event]) { | |
| self.userInteractionEnabled = YES; | |
| } else { | |
| self.userInteractionEnabled = NO; | |
| } | |
| UIView *view = [super hitTest:point withEvent:event]; | |
| return view; | |
| } | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2014-08-16 18:07:23.846 HitTest[79584:60b] hitTest point.y=37.0 // NavigationBarの中でタップ、1度目 | |
| 2014-08-16 18:07:23.849 HitTest[79584:60b] hitTest point.y=37.0 // NavigationBarの中でタップ、2度目 | |
| 2014-08-16 18:07:26.692 HitTest[79584:60b] hitTest point.y=49.5 // NavigationBarの外でタップ、1度目 | |
| 2014-08-16 18:07:26.693 HitTest[79584:60b] hitTest point.y=49.5 // NavigationBarの外でタップ、2度目 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2014-08-16 18:09:52.293 HitTest[79743:60b] hitTest point.y=37.0 // NavigationBarの中でタップ、1度目 | |
| 2014-08-16 18:09:52.296 HitTest[79743:60b] hitTest point.y=37.0 // NavigationBarの中でタップ、2度目 | |
| 2014-08-16 18:09:56.658 HitTest[79743:60b] hitTest point.y=49.0 // (A)NavigationBarの外でタップ、1度目 | |
| 2014-08-16 18:09:56.659 HitTest[79743:60b] hitTest point.y=34.0 // (B)NavigationBarの外でタップ、2度目 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment