swift - 如何使用 Swift 在 UITabbar 第一个项目上添加自定义标签
问题描述
我的场景,我需要在 UITabbar 第一项中心位置添加一个自定义标签,因为基于标签中心位置,我将在其上应用圆形过渡起点。
我的代码如下
func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
transition.transitionMode = .present
transition.startingPoint = customLabel.center // here I need to get custom label center position
return transition
}
func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
transition.transitionMode = .dismiss
transition.startingPoint = customLabel.center
return transition
}
解决方案
推荐阅读
- javascript - 如何通过公共嵌入式应用将 Shopify ScriptTag 发布到 Shopify 主题?
- r - 将公式应用于 R 中的数据
- postgresql - 试图将graphql连接到postgress如何定义用户并通过?
- java - Java 8 按小时分组对象
- node.js - 针对外部 API 验证 Mongoose Schema
- python - python测试self中定义的属性
- python - 无法使用 Python 请求获取 JSON 响应
- android - 如何在 RxJava2 中的错误返回时发出多个项目?
- tensorflow - Tensorflow-js:`tf.placeholder` 的等价物是什么?
- typescript - 多部分数据的端到端测试