gpt4 book ai didi

ios - 选择部分 GLKViewController

转载 作者:行者123 更新时间:2023-11-29 01:15:08 24 4
gpt4 key购买 nike

我正在尝试实现 this在我的项目中。但是我有一些麻烦。我计划使用 UiPanGestureRecognizer 来改变矩形的大小。据我了解,我应该使用 UIVIew 和自定义 drawRect 方法吗?

最佳答案

为您的 UIPanGestureRecognizer 添加操作并使用翻译:

func wasDragged(gesture: UIPanGestureRecognizer) {
let translation = gesture.translationInView(self.view)
// Do your resizing here, e.g. from a
customView.frame.size.width = currentFrame.width + translation.x
customView.frame.size.height = currentFrame.height + translation.y

if gesture.state == .Ended {
currentFrame = customView.frame
}
}

使用此方法,添加一个 CGRect 变量来存储 currentFrame

关于ios - 选择部分 GLKViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35273454/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com