- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个嵌套的 UIViewController 覆盖了屏幕的一半。
在此 Controller 下有父 ViewController。
我只想将横向滑动事件传播到底部(父) Controller 。
我想我应该使用以下函数
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
return (my test)
})
}
但我也知道这个函数应该应用于 UIView,而不是 UIViewController。所以我陷入困境,我不知道如何继续。
最佳答案
您可以创建
class SomeView:UIView {
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
return true/false
}
}
并将其分配给IB中子级的vc'view,您也可以在vc内部实现
override func touchesBegan(_ touches: Set<AnyHashable>, withEvent event: UIEvent) {
var touch: UITouch? = touches.first
//location is relative to the current view
// do something with the touched point
if touch?.view == childVC.view {
}
}
编辑:
要将滑动操作传播到父级,请添加委托(delegate)并将滑动操作传递给子级,并在触发时使用委托(delegate)通知父级
关于iOS swift : Propagates Swipe Events from nester controller to underneath controller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56200734/
我们发生了一个生产事件,导致一堆线程陷入僵局,服务器停止工作。为了进行调查,我测试了一些具有不同的Spring事务传播的东西,如果我没有记错的话,如果根本没有现有的事务,那么REQUIRES_NEW传
我有一个简单的 CRUD 项目。我有一个使用 Hibernate 5 和 Spring Boot 的简单 CRUD 项目。当我使用@Transactional(propagation = Propag
这是我的问题: 我正在 Java EE/Spring/Hibernate 应用程序上运行批处理。此批处理调用 method1。这个方法调用一个method2,它可以抛出UserException(一个
有人可以解释为什么第一个单元测试类工作而第二个测试类失败并出现锁定等待超时错误? 第一个类: public class Test1 extends AbstractTransactionalJUnit
如果我有以下代码: @Component public class A{ @Transactional(propagation = Propagation.REQUIRED) public void
在 Spring 文档中,对于 NEVER 传播: Execute non-transactionally, throw an exception if a transactionexists. 我想
根据Spring javadoc @Transactional(propagation = Propagation.SUPPORTS) Support a current transaction, e
我将 jHipster 与 Spring Data JPA 一起使用,并具有以下方法: @Transactional(propagation=Propagation.REQUIRES_NEW) pub
我正在使用 spring 和 hibernate,并使用 spring 事务管理器。我有以下方法,它是从另一个事务性方法调用的。 @Transactional (readOnly = true, pr
现在基本设置都可以了,我开始尝试交易。Struts+Spring+Hibernate注解事务管理器。这是 Action 中的示例代码,将调用一个服务类: userService.addUser
我有这样的代码 @Transactional(propagation = Propagation.NESTED) @TransactionConfiguration(transactionManage
方法与有什么区别 @Transactional(propagation = Propagation.SUPPORTS) 还有一个没有@Transactional的方法? 例如: public clas
当启动新事务时,在使用@Transactional(propagation = Propagation.REQUIRED)启动的当前事务中使用@Transactional(propagation =
方法与 @Transactional(propagation = Propagation.SUPPORTS) 有什么区别vs 没有 @Transactional注释? @Transactional(p
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) public void abc()
每当我尝试 entityManager.flush() 时,我都会收到标题中提到的错误。有趣的是,我的所有模型都在应用程序启动期间在 MySql 上正确创建。 我已经阅读了几个具有类似异常的问题,基本
我正在开发一个 java (spring/hibernate) 应用程序,它是一种限时且数量有限的销售平台。也就是说,我必须在上午 10 点到 11 点的时间段内只销售 1000 张某种类型的卡片。我
@Transactional(rollbackFor = Exception.class) public void foo1() { `/**Some Code**/` } @Transact
我将我正在开发的应用程序从使用 AspectJ 加载时间编织切换到使用 Spring CGlib 代理,并且在我这样做之后,我开始在代码的许多部分中获得 hibernate 延迟加载异常,而在过去有没
我一直在尝试追踪现有 MySQL(5.7,Linux)代码中的错误行为。我对我发现的行为感到震惊/困惑/不高兴当子查询返回错误时: SELECT * FROM charges WHERE Charge
我是一名优秀的程序员,十分优秀!