有誰知道爲什麼把地圖設置爲混合不起作用。將它設置爲標準,衛星工作正常嗎?將地圖設置爲混合不起作用?
。 。 。
[segmentedControl addTarget:self action:@selector(handleSegmentClick:) forControlEvents:UIControlEventValueChanged];
[window makeKeyAndVisible];
return YES;
}
- (void)handleSegmentClick:(id)sender
{
NSLog(@"changeSegment");
UISegmentedControl *sc = (UISegmentedControl *)sender;
NSInteger index = sc.selectedSegmentIndex;
switch (index)
{
case 0:
[mapView setMapType: MKMapTypeStandard];
break;
case 1:
[mapView setMapType: MKMapTypeSatellite];
break;
case 2:
[mapView setMapType: MKMapTypeHybrid];
break;
default:
break;
}
}
不,我通過模擬器運行它,但這可能是原因嗎?它切換到標準視圖和一切。讓我添加代碼的其餘部分 – TheLearner 2010-06-01 15:54:46
將一些日誌語句放入您的switch語句中,以查看混合案例是否真的被調用。這可能會給出線索發生的事情。嘗試將第一種情況改爲混合。 – 2010-06-01 17:14:39
是的混合動力車實際上被稱爲 – TheLearner 2010-06-02 09:06:13