隐藏 MKPolylineView 会导致模糊而不是隐藏
我使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果它按照 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