- (void)setupMapView {
MKMapView *mapView = [[MKMapView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
mapView.showsUserLocation = YES;
CLLocationCoordinate2D location = CLLocationCoordinate2DMake(39.5427, 116.2317);
MKCoordinateSpan span = MKCoordinateSpanMake(0.1, 0.1);
MKCoordinateRegion region = MKCoordinateRegionMake(location, span);
[mapView setRegion:region animated:YES];
[self.view addSubview:mapView];
}
本文介绍如何使用Objective-C在iOS应用中设置并显示地图视图,包括定位到特定坐标及设置地图缩放级别。
1348

被折叠的 条评论
为什么被折叠?



