- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我通过将描边颜色设置为红色制作了一个带有几个点的CAShapeLayer
。然后我用 UIImage
的图案填充颜色。我想使用 UIRotationGestureRecognizer
旋转 CAShapeLayer
及其填充图案。
我使用了 CATransform3DRotate,但它无法正常工作。
CATransform3D transform = CATransform3DIdentity;
transform = CATransform3DRotate(transform, recognizer.rotation, 0.0, 0.0, 1.0);
shapeLayer.transform = transform;
提前致谢
最佳答案
您需要调用:
shapeLayer.anchorPoint = (CGPoint){0.5, 0.5};
您还从恒等变换开始,它会丢弃您之前完成的任何变换,例如定位图层。你想要做的是:
shapeLayer.transform = CATransform3DRotate(shapeLayer.transform, recognizer.rotation, 0.0, 0.0, 1.0);
关于ios - 如何在中心点旋转 CAShapeLayer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20996065/
如何让div的中心点作为旋转的中心点。 我遇到了 this虽然我正在做一些研究,但我似乎无法将其融入我的研究。 这就是帖子所建议的。但不起作用。$(area).css('-webkit-transfo
您好,我正在做一个应用程序,在我的应用程序中有一个 map 页面,所以我实现了 Google Maps V2,我遇到了一个问题,当我滚动 map 时,我想获得 map 的中心点,如果我滚动 map ,
我正在玩一个简单的 2d 游戏,我正在尝试从级别 1(场景一)切换到级别 2(场景二)。为了测试,两个级别包含相同的内容。这是我的转换代码: let transition = SKTransi
我有一个覆盖大部分屏幕区域的 map 的 View 。 在 map 的顶部,我有一些图像、按钮、文本框。它们位于 map 的顶部,我在这里称其为“无用 map ”,而底部则用于实际查看 map 。这是
给定一个纯白色背景上的对象,有人知道 OpenCV 是否提供了从捕获的帧中轻松检测对象的功能吗? 我正在尝试定位对象(矩形)的角点/中心点。我目前这样做的方式是通过蛮力(扫描对象的图像)并且不准确。我
我试图确保我的 map 中心点位于 kml 层的边界内,我无法找到很多相关信息,但我修改了来自 here 的一些代码。这似乎可行,但当然行不通。 从 Google Maps API 中,我无法判断 .
我试图在用户滚动 UIScrollView 时创建一个非常简单的视差效果。我在我的 ScrollView 上使用 scrollViewDidScroll 方法,一切正常。我可以记录该方法的所有内容,因
我正在使用 svg.js 和出色的 svg-pan-zoom 插件 ( https://github.com/ariutta/svg-pan-zoom )。 现在我想要一个按钮,当我单击它时,它会在我
我是一名优秀的程序员,十分优秀!