- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 UIControlEventTouchDown
事件为简单的 UIButton
调用操作,它放置在 UIViewController
的左下角(用UINavigationController
).
我创建了 Storyboard来使用按钮推送 View Controller 。
并为按钮添加了跟踪触摸事件的 Action 。
- (IBAction)touchUpInside:(id)sender {
NSLog(@"touchUpInside");
}
- (IBAction)touchDown:(id)sender {
NSLog(@"touchDown");
}
并且还添加了 touchesBegan 来跟踪它是否被调用。
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[self touchesBegan:touches withEvent:event];
NSLog(@"touchesBegan");
}
现在,有了这样的设置,我有奇怪的行为。左侧(宽度 =13)和左下角(宽度 = 50,高度 = 50)有一些触摸区域,它们对触摸的响应不同。如果您将触摸这些区域 - touchesBegan 不会像正常行为那样在触地时被调用。但是只有在 touch up 之后才会被调用。
我相信左侧区域在 UINavigationControoler 中用于推送 UIViewController 的交互式弹出。所以这里有两个问题。
最佳答案
我遇到了同样的问题,我通过禁用 iOS 7 中引入的“滑动返回”(技术上称为 UIKit 中的“交互式弹出手势”)功能解决了这个问题。
禁用交互式弹出手势的示例代码:
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
我认为这是由于交互式弹出手势识别器消耗/延迟了屏幕左边缘附近的触摸事件(因为从左边缘开始滑动返回),因此导致触摸事件未传递到位于 View 左边缘附近的控件。
关于ios - 屏幕左/左下角的 UINavigationController 和触摸事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19867462/
我是 CSS 转换样式的新手。所以我没弄清楚这件事。我玩过这段代码。但它在右侧有一个 Angular 。但我需要左侧的 Angular 形状。像这样。我该如何创建它?或针对这种情况的任何其他方法? d
阅读代码 https://www.gstatic.com/recaptcha/api2/v1531759913576/recaptcha__en.js有许多对 bottomleft 的引用(我认为与通
所以,我一直在尝试将 放到 的底部。在代码中,您可以看到我尝试使用相对位置和 bottom :0 来执行此操作,但它什么也没做。我可以向右浮动,所以我只需要将它放到底部即可。现在它只是一直放在文本的正
我有一个 div,我想在 div 的右下角放一张图片,在左下角放一些图片。它们的高度不同,所以我想确保它们都与 div 的底部对齐。 首先,我使用以下方法使右下角对齐: position: ab
我是一名优秀的程序员,十分优秀!