隐藏 MKPolylineView 会导致模糊而不是隐藏

发布于 2024-09-24 10:50:30 字数 715 浏览 1 评论 0原文

我使用 MKPolylineview 在地图上显示路线。

我有两个按钮,一个用于显示路线,一个用于隐藏路线。

在装有 ios 4.0.2 的 iPhone 上,当我单击按钮时,路线会隐藏并显示得非常好。

在安装了 ios 4.1 的 iPhone 上,路线显示正常。当我单击按钮隐藏路线时,线条的尺寸扩大了 2 倍(大致)并变得模糊。

如果我调整缩放级别,它最终会消失。有时,当我放大时,当我经过某个缩放级别时,它会立即重新出现。 (我知道 MapKit 从技术上讲没有缩放级别,但我希望您明白我的意思)。

4.1 的模拟器中也会出现线条模糊效果。它不会出现在应用商店中使用先前 SDK 版本构建的先前版本中。

单击按钮时隐藏路线的代码片段如下。

-(IBAction) segmentedControlIndexChanged{
switch (self.control.selectedSegmentIndex) {
    case 0:{
         NSArray *allValues = [routeLineViews allValues];
         for(MKOverlayView *lineView in allValues){
           lineView.hidden = YES;
         }
         [map setNeedsLayout];
          break;
   }
}

I use MKPolylineview to show a route on a map.

I have two buttons, one to display the route, one to hide the route.

On an iPhone with ios 4.0.2 the route hides and displays perfectly fine when I click the buttons.

On an iPhone with ios 4.1 installed the route displays fine. When I click the button to hide the route the line expands in size x2(roughly) and becomes blurred.

If I play with the zoom level it then eventually disappears. At times when I zoom back in it reappears momentarily as I pass through a certain zoom level. (I know there are technically no zoom levels in MapKit but I hope you get my meaning).

The line blurring effect happens in the simulator also with 4.1. It does not appear on a previous version of my app in Store that was built with the previous SDK release.

The snippet of code that hides the route when the button is clicked is below.

-(IBAction) segmentedControlIndexChanged{
switch (self.control.selectedSegmentIndex) {
    case 0:{
         NSArray *allValues = [routeLineViews allValues];
         for(MKOverlayView *lineView in allValues){
           lineView.hidden = YES;
         }
         [map setNeedsLayout];
          break;
   }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风透绣罗衣 2024-10-01 10:50:30

如果它按照 iOS 4.0.2 中记录的方式工作,然后在没有任何代码更改的情况下在 iOS 4.1 中无法工作,我认为这是一个 SDK 错误,您应该向 Apple 提交错误报告。

如果可以的话,我建议尝试在示例项目中重现该缺陷,将其与任何其他代码隔离。该项目可以附加错误报告,并将帮助苹果决定如何处理它。

您可以在 http://bugreporter.apple.com 报告错误

If it worked as documented in iOS 4.0.2 and then doesn't work in iOS 4.1 without any code changes, I would expect that to be an SDK bug and you should raise a bug report with Apple.

If you can, I would suggest trying to reproduce the defect in a sample project, isolating it from any of your other code. This project can be attached with the bug report and will help Apple in deciding what to do with it.

You can report a bug at http://bugreporter.apple.com

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文