我有一个IPad应用程序,我在其中以编程方式添加MKMapView而不使用NIB。
{
CGRect r = CGRectMake(0, 0, 768, 980);
//CGRect r = CGRectMake(0, 0, 1004, 1004);
mapView = [[MKMapView alloc] initWithFrame:r];
mapView.showsUserLocation = FALSE;
mapView.mapType = MKMapTypeStandard;
//mapView.mapType = MKMapTypeHybrid;
//mapView.mapType = MKMapTypeSatellite;
mapView.delegate = self;
/*Region and Zoom*/
// one degree = 69 miles
// get the distance
// .01 = 1 mile square
//float distance = controller.itemDistance;
float distance = 1.0;
distance = distance/100.0;
MKCoordinateRegion region;
MKCoordinateSpan span;
span.latitudeDelta = distance;
span.longitudeDelta = distance;
CLLocationCoordinate2D location = mapView.userLocation.coordinate;
location.latitude = currLocation.coordinate.latitude;
location.longitude = currLocation.coordinate.longitude;
region.span = span;
region.center = location;
[mapView setRegion:region animated:TRUE];
[mapView regionThatFits:region];
[self addSubview:mapView];
[self addAnnotation];
}
我遇到的问题是GOOGLE徽标没有显示在MAP的底部,也没有显示版权声明。因此,该应用程序已被App Store拒绝。任何人都可以帮助在MAP上添加徽标吗?
提前致谢
答案 0 :(得分:1)
可能是您的mapview比想要添加的视图大。记录框架的高度和视图宽度,并查看它是否小于mapView。
还要考虑添加[self setClipToBounds:NO];
并查看mapView是否泛滥。