Tag: 坐标

MKPolygon覆盖整个地球

我正在尝试创build一个覆盖整个地球的MKPolygon,但找不到合适的坐标。 我的代码如下所示: CLLocationCoordinate2D pathCoords[5]={ CLLocationCoordinate2DMake(0,-90), CLLocationCoordinate2DMake(0,90), CLLocationCoordinate2DMake(-180,90), CLLocationCoordinate2DMake(180,-90), CLLocationCoordinate2DMake(0,-90), }; MKPolygon *result = [MKPolygon polygonWithCoordinates:pathCoords count:5]; 我发现这篇文章可以帮助您: http : //www-01.ibm.com/support/knowledgecenter/SSEPGG_9.5.0/com.ibm.db2.luw.spatial.topics.doc/doc/geodnew1039296.html 但是在mapKit中使用这些协调的收益总是不同的结果。 谁能帮忙?

iOS使用Quartz旋转UIImage

我有一个自定义的UIView子类 – (void)drawRect:(CGRect)rect 我想在位置50,50绘制一个UIImage,并旋转20度。 我试了下面的代码: CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSaveGState(context); CGContextRotateCTM (context, degreesToRad(20)); [image drawAtPoint:CGPointMake(50, 50)]; CGContextRestoreGState(context); 它正确旋转图像,但它不是在50,50 … 如何在保持正确坐标的同时旋转UIImage?

ScrollView中最后一个元素的坐标

我有这个滚动视图与许多元素里面的高度是可变的。 我想知道是否有一种方法可以知道scrollview中最后一个元素的最大值,而不会增加scrollview中所有元素的高度。 我试过lastViewInScrollView.frame.maxY,这是不对的。

Swift 3.0从不同的视图控制器获取用户位置坐标

我有两个视图控制器 – 一个是能够通过locationManager获得用户位置协调的mapView,另一个是我希望能够拉动这些用户坐标的VC。 首先VC:MapView func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { var coordinatesOfUser = locations.last?.coordinate print("The value of usercoordinates are \(coordinatesOfUser)") // here I want to be able to pull this variable, coordinatesOfUser if let location = locations.last { let span = MKCoordinateSpanMake(0.00775, 0.00775) let myLocation = CLLocationCoordinate2DMake(location.coordinate.latitude,location.coordinate.longitude) let region = MKCoordinateRegionMake(myLocation, span) map.setRegion(region, […]

在Swift中获取多个触摸的坐标

所以我一直在试图获得触摸屏的坐标。 到目前为止,我可以通过这个获得一个触摸的坐标: override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { let touch = touches.anyObject()! as UITouch let location = touch.locationInView(self.view) println(location) } 但是当用两根手指触摸时,我只能得到第一次触摸的坐标。 多点触摸的作品(我用这个小教程testing: http : //www.techotopia.com/index.php/An_Example_Swift_iOS_8_Touch,_Multitouch_and_Tap_Application )。 所以我的问题是,我如何获得第二(和第三,第四…)触摸的坐标?

如何将MGRS转换成十进制度数

我正在做一个iPhone应用程序。 我想我的应用程序将MGRS坐标转换为十进制度。 如何以编程方式执行此操作?

如何增加或减lessSwift中button的大小?

我在我的应用程序中有一个UIButton ,我称之为“buttonPlay”。 我正在使用AutoLayout,但该button没有任何附加的NSLayoutConstraints 。 我想编码animation来增加和减lessbutton的高度和宽度 。 以下是animation代码的外观: // "Repeat" because the animation must repeat itself UIView.animateWithDuration(1.0, delay: 0.6, options: UIViewAnimationOptions.Repeat, animations: { // Animation code goes here // nil: the animation is not supposed to end }, completion: nil) } 要获得x位置的原始值,y位置,宽度和高度,我使用下面的代码: var frmPlay : CGRect = self.buttonPlay.frame // get the current x and y positions […]

如何检测在iOS最小的button点击?

我需要build立一个有图像的应用程序。 在图像上有许多点,用户可以点击并依赖于该点击的位置,我们需要input。 点按位置是固定的。 用户可以放大图像。 检测多个水龙头。 (单击,双击等) 我们面临的最大问题是彼此靠近点太多。 所以如果我们点击一​​点,我们正在点击其他点。 以下是我需要处理的图像。 我需要检测所有红点,并据此作出决定。 用户不会看到这些红点。 我所尝试的是以下。 如图所示放置图像上的button。 但问题是当用户点击button的任何一个button的点击事件没有调用,或者它不是点击用户似乎点击的右键。 我现在想要做的是。 在滚动视图中获取图像,然后检测滚动视图的点击,然后基于坐标检测点击。 有没有更简单的方法来检测水龙头?

使用locationOfTouch查找手势触摸的坐标

嘿,一直在试图获取用户的滑动位置,以便我可以在屏幕上有3个可滑动的区域,并根据他们的滑动的y坐标确定他们与哪个部分作出反应。 这是代码 CGPoint touchPoint = [recognizer locationOfTouch:0 inView:nil]; 我已经尝试在标签中打印touchPoint.y,我得到的是0.如何获得用户刷卡的坐标? 谢谢。

如何在iOS / ObjectiveC中获取TouchPoint的坐标和像素颜色

我需要在Objective-C中获得TouchPoint的Coordinates和PixelColor。 这甚至有可能吗? 如果是的话,我会对如何正确的方向或任何暗示非常感兴趣。 感谢名单!