Skip to content

Commit

Permalink
解决检测视图右上角按钮横屏之后失效
Browse files Browse the repository at this point in the history
  • Loading branch information
HuginChen committed May 6, 2019
1 parent d7d2d15 commit a7bff3e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ - (void)drawTipViewWithValue:(NSString *)tip point:(DoraemonPoint *)point time:(
//self.indicatorLayer.frame = CGRectMake(point.x, 0, 1, self.bottomLine.doraemon_bottom);
}

- (void)clear{
- (void)clear {
if (_pointLayerList.count>0) {
for (CALayer *layer in _pointLayerList) {
[layer removeFromSuperlayer];
Expand All @@ -206,4 +206,7 @@ - (void)clear{
_tipLabel.hidden = YES;
}




@end
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,15 @@ - (void)becomeKeyWindow{
}

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event{
if (point.x>DoraemonScreenWidth-kDoraemonSizeFrom750(60) && point.y<kDoraemonSizeFrom750(60)+IPHONE_TOPSENSOR_HEIGHT) {
return [super pointInside:point withEvent:event];
// 检测视图右上角的按钮,传递事件才能关闭,这里是横屏适配
if (kInterfaceOrientationPortrait) {
if (point.x > DoraemonScreenWidth-kDoraemonSizeFrom750_Landscape(60) && point.y < kDoraemonSizeFrom750_Landscape(60)+IPHONE_TOPSENSOR_HEIGHT) {
return [super pointInside:point withEvent:event];
}
} else {
if (point.x > DoraemonScreenHeight-kDoraemonSizeFrom750_Landscape(60) && point.y < kDoraemonSizeFrom750_Landscape(60)+IPHONE_TOPSENSOR_HEIGHT) {
return [super pointInside:point withEvent:event];
}
}
return NO;
}
Expand Down

0 comments on commit a7bff3e

Please sign in to comment.